diff --git a/.github/workflows/package-and-release.yaml b/.github/workflows/package-and-release.yaml index 0001b778b33..ea348919c01 100644 --- a/.github/workflows/package-and-release.yaml +++ b/.github/workflows/package-and-release.yaml @@ -189,6 +189,7 @@ jobs: secrets: inherit with: version: ${{ needs.create-tag.outputs.version }} + is_major_version: ${{ needs.get-params.outputs.is-release-candidate !='true' && needs.get-params.outputs.should-create-release == 'true' }} release-docs: needs: [ get-params, diff --git a/.github/workflows/publish-release-image.yaml b/.github/workflows/publish-release-image.yaml index 745b296a451..58b2e3c3ddd 100644 --- a/.github/workflows/publish-release-image.yaml +++ b/.github/workflows/publish-release-image.yaml @@ -6,7 +6,10 @@ on: version: required: true type: string - + is_major_version: + required: true + type: boolean + default: false jobs: create-docker-image: strategy: @@ -32,7 +35,9 @@ jobs: - name: Get the name of the wheel and set up env variables run: | echo "WHEEL_FILENAME=$(ls -1 *.whl)" >> $GITHUB_ENV - TAG_NAME=ghcr.io/${{ github.repository }}/tt-metalium/${{ matrix.os }}-amd64/${{ matrix.arch }}:${{ inputs.version }} + REPO_IMAGE_NAME=ghcr.io/${{ github.repository }}/tt-metalium/${{ matrix.os }}-amd64/${{ matrix.arch }} + echo "REPO_IMAGE_NAME=$REPO_IMAGE_NAME" >> $GITHUB_ENV + TAG_NAME=$REPO_IMAGE_NAME:${{ inputs.version }} echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV - name: Build and push uses: docker/build-push-action@v6 @@ -44,3 +49,10 @@ jobs: tags: ${{ env.TAG_NAME }} context: . file: dockerfile/release.Dockerfile + + - name: Tag latest if this is a major version release + if: ${{ is_major_version }} + run: | + docker pull $TAG_NAME + docker tag $TAG_NAME $REPO_IMAGE_NAME:latest + docker push $REPO_IMAGE_NAME:latest