From 04ce70c935daaaac20eb48987022516e5da036b4 Mon Sep 17 00:00:00 2001 From: Bailey <7989183+Zindswini@users.noreply.github.com> Date: Thu, 30 Mar 2023 05:18:47 +0000 Subject: [PATCH] Maintain the Current OCI Version Label --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 968cc0c7..9cb95217 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,13 @@ jobs: - name: Checkout Push to Registry action uses: actions/checkout@v3 + - name: Get current version + id: labels + run: | + docker pull ghcr.io/ublue-os/${{ matrix.image_name }}-main:${{ matrix.major_version }} + ver=$(docker inspect ghcr.io/ublue-os/${{ matrix.image_name }}-main:${{ matrix.major_version }} | jq -r '.[].Config.Labels["org.opencontainers.image.version"]') + echo "VERSION=$ver" >> $GITHUB_OUTPUT + # Build metadata - name: Image Metadata uses: docker/metadata-action@v4 @@ -42,6 +49,7 @@ jobs: ${{ format('bazzite{0}', matrix.image_name) }} labels: | io.artifacthub.package.readme-url=https://raw.githubusercontent.com/ublue-os/bazzite/main/README.md + org.opencontainers.image.version=${{ steps.labels.outputs.VERSION }} - name: Generate tags id: generate-tags @@ -133,4 +141,4 @@ jobs: - name: Echo outputs if: github.event_name != 'pull_request' run: | - echo "${{ toJSON(steps.push.outputs) }}" \ No newline at end of file + echo "${{ toJSON(steps.push.outputs) }}"