From 759d457d48e9e6c679ab0ed8028806d06a4f4c33 Mon Sep 17 00:00:00 2001 From: Amit Parekh <7276308+amitkparekh@users.noreply.github.com> Date: Fri, 1 Dec 2023 16:56:17 +0000 Subject: [PATCH] ci: try get the version from poetry --- .github/workflows/build-image.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index f6714f5..ebe3e70 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -25,17 +25,27 @@ jobs: packages: write steps: + - name: Check out the repository + uses: actions/checkout@v4 + + - 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 }} + cache: "poetry" + - name: Define image suffix id: image-tag env: TORCH_VERSION_SUFFIX: ${{ matrix.torch_version_suffix }} run: | + IMAGE_TAG=$(poetry version -s) IMAGE_TAG=$(echo "$TORCH_VERSION_SUFFIX" | tr + -) echo "tag=$IMAGE_TAG" >> "$GITHUB_OUTPUT" - - name: Check out the repository - uses: actions/checkout@v4 - - name: Log in to the Container registry uses: docker/login-action@v3 with: @@ -49,7 +59,7 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }} tags: | - type=pep440,enable=true,priority=900,suffix=${{ steps.image-tag.outputs.tag }} + ${{ steps.image-tag.outputs.tag }} - name: Build and push image uses: docker/build-push-action@v5