Fix reporting of version in prebuilt binaries & docker image

This commit is contained in:
Quentin Gliech
2025-01-27 10:34:21 +01:00
parent 057256305c
commit 3b744c7881
4 changed files with 60 additions and 3 deletions

View File

@@ -31,10 +31,37 @@ env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
jobs:
compute-version:
name: Compute version using git describe
runs-on: ubuntu-24.04
outputs:
describe: ${{ steps.git.outputs.describe }}
timestamp: ${{ steps.git.outputs.timestamp }}
steps:
- name: Checkout the code
uses: actions/checkout@v4.2.2
with:
# Need a full clone so that `git describe` reports the right version
fetch-depth: 0
- name: Compute version and timestamp out of git history
id: git
run: |
echo "describe=$(git describe --tags --match 'v*.*.*' --always)" >> $GITHUB_OUTPUT
echo "timestamp=$(git log -1 --format=%ct)" >> $GITHUB_OUTPUT
build-binaries:
name: Build binaries
runs-on: ubuntu-22.04
needs:
- compute-version
env:
VERGEN_GIT_DESCRIBE: ${{ needs.compute-version.outputs.describe }}
SOURCE_DATE_EPOCH: ${{ needs.compute-version.outputs.timestamp }}
permissions:
contents: read
@@ -136,6 +163,13 @@ jobs:
packages: write
id-token: write
needs:
- compute-version
env:
VERGEN_GIT_DESCRIBE: ${{ needs.compute-version.outputs.describe }}
SOURCE_DATE_EPOCH: ${{ needs.compute-version.outputs.timestamp }}
steps:
- name: Docker meta
id: meta