From 368b9a8be12e9728b50a5b92745f92e227d92132 Mon Sep 17 00:00:00 2001 From: Amit Parekh <7276308+amitkparekh@users.noreply.github.com> Date: Fri, 1 Dec 2023 18:42:41 +0000 Subject: [PATCH] ci: no new versions, but keep building images --- .github/workflows/build-image.yml | 11 ++++---- .github/workflows/releases.yml | 45 ++++--------------------------- 2 files changed, 11 insertions(+), 45 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 2f58f0b..d6979ff 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -1,6 +1,7 @@ name: Build and push images on: + workflow_call: workflow_dispatch: release: types: [published] @@ -28,16 +29,16 @@ jobs: - name: Check out the repository uses: actions/checkout@v4 - - name: Install Poetry - run: pipx install poetry - - name: Define image suffix id: image-tag env: TORCH_VERSION_SUFFIX: ${{ matrix.torch_version_suffix }} run: | - IMAGE_TAG=$(poetry version -s | tr -d 'v') - IMAGE_TAG=$(echo "$IMAGE_TAG$TORCH_VERSION_SUFFIX" | tr + -) + if [ -z "$TORCH_VERSION_SUFFIX" ]; then + TORCH_VERSION_SUFFIX="cpu" + exit 0 + fi + IMAGE_TAG=$(echo "$IMAGE_TAG$TORCH_VERSION_SUFFIX" | tr -d "+") echo "tag=$IMAGE_TAG" >> "$GITHUB_OUTPUT" - name: Log in to the Container registry diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index fc647d0..045e5d6 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -2,8 +2,7 @@ name: Releases on: push: - branches: - - main + branches: [main] env: PYTHON_VERSION: 3.9 @@ -29,42 +28,8 @@ jobs: uses: "./.github/workflows/tests.yml" secrets: inherit - release: - name: Release - runs-on: ubuntu-latest + build_image: + name: Build image + uses: "./.github/workflows/build-image.yml" + secrets: inherit needs: [continuous-integration, tests] - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - token: ${{ secrets.PAT }} - - - name: Setup Git - env: - PAT: ${{ secrets.PAT }} - USERNAME: ${{ secrets.SIMBOT_BOT_USERNAME }} - EMAIL: ${{ secrets.SIMBOT_BOT_EMAIL }} - run: | - git config user.name "${USERNAME}" - git config user.email "${EMAIL}" - git config --global url."https://${PAT}@github.com/".insteadOf "https://github.com/" - - - name: Install Poetry - run: pipx install poetry - - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: "lts/*" - - - name: Install semantic release - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - run: | - npm install --no-save @bjoluc/semantic-release-config-poetry - npx semantic-release