Maintain the Current OCI Version Label

This commit is contained in:
Bailey 2023-03-30 05:18:47 +00:00 committed by GitHub
parent 04fa577f97
commit 04ce70c935
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) }}"
echo "${{ toJSON(steps.push.outputs) }}"