From 116e53a9e6bc183f174b06f8b54204be8d03dfab Mon Sep 17 00:00:00 2001 From: EinoHR <60004820+EinoHR@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:47:51 +0300 Subject: [PATCH] fix: always get version tags (#134) --------- Co-authored-by: Scott Ames --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index edc1a6a661..43434f0b74 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,13 +64,19 @@ jobs: echo "FEDORA_MAJOR_VERSION=$(yq '.fedora-version' ./${{ matrix.recipe }})" >> $GITHUB_ENV echo "BASE_IMAGE_URL=$(yq '.base-image' ./${{ matrix.recipe }})" >> $GITHUB_ENV + - name: Get current version + id: labels + run: | + ver=$(skopeo inspect docker://${{ env.BASE_IMAGE_URL }}:${{ env.FEDORA_MAJOR_VERSION }} | jq -r '.Labels["org.opencontainers.image.version"]') + echo "VERSION=$ver" >> $GITHUB_OUTPUT + - name: Generate tags id: generate-tags shell: bash run: | # Generate a timestamp for creating an image version history TIMESTAMP="$(date +%Y%m%d)" - MAJOR_VERSION="${{ env.FEDORA_MAJOR_VERSION }}" + MAJOR_VERSION="$(echo ${{ steps.labels.outputs.VERSION }} | cut -d . -f 1)" COMMIT_TAGS=() BUILD_TAGS=() # Have tags for tracking builds during pull request @@ -98,12 +104,6 @@ jobs: done echo "alias_tags=${alias_tags[*]}" >> $GITHUB_OUTPUT - - name: Get current version - id: labels - run: | - ver=$(skopeo inspect docker://${{ env.BASE_IMAGE_URL }}:${{ env.FEDORA_MAJOR_VERSION }} | jq -r '.Labels["org.opencontainers.image.version"]') - echo "VERSION=$ver" >> $GITHUB_OUTPUT - # Build metadata - name: Image Metadata uses: docker/metadata-action@v4