From eca12e175e66e1318aa849037c2707494f69ec3b Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Tue, 10 Feb 2026 11:29:22 -0500 Subject: [PATCH] chore: create tag for each release and use for publishing This follows the same syntax used to stamp the Docker images, so all artifacts should be kept entirely in sync. --- .github/workflows/main.yaml | 8 +++++++- tools/github_workflows/workflows_template.libsonnet | 13 +++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b241f2fc..25d1a239 100755 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -668,12 +668,18 @@ "name": "Calculate shasum", "run": "shasum -a 256 assets/* > sha256" }, + { + "id": "create_tag", + "name": "Generate tag", + "run": "BUILD_SCM_REVISION=$(git rev-parse --short HEAD)\nBUILD_SCM_TIMESTAMP=$(TZ=UTC date --date \"@$(git show -s --format=%ct HEAD)\" +%Y%m%dT%H%M%SZ)\nRELEASE_TAG=\"${BUILD_SCM_TIMESTAMP}-${BUILD_SCM_REVISION}}\"\ngit tag -a $RELEASE_TAG\ngit push --follow-tags\necho \"release_tag=$RELEASE_TAG\" >> $GITHUB_OUTPUT\n" + }, { "name": "Create GitHub release and upload artifacts", "uses": "softprops/action-gh-release@v2", "with": { "files": "assets/*\nsha256\n", - "make_latest": true + "make_latest": true, + "tag_name": "${{ steps.create_tag.outputs.release_tag }}" } } ] diff --git a/tools/github_workflows/workflows_template.libsonnet b/tools/github_workflows/workflows_template.libsonnet index 618ceb04..c5c2dab7 100644 --- a/tools/github_workflows/workflows_template.libsonnet +++ b/tools/github_workflows/workflows_template.libsonnet @@ -165,11 +165,24 @@ name: 'Calculate shasum', run: 'shasum -a 256 assets/* > sha256', }, + { + name: 'Generate tag', + id: 'create_tag', + run: ||| + BUILD_SCM_REVISION=$(git rev-parse --short HEAD) + BUILD_SCM_TIMESTAMP=$(TZ=UTC date --date "@$(git show -s --format=%ct HEAD)" +%Y%m%dT%H%M%SZ) + RELEASE_TAG="${BUILD_SCM_TIMESTAMP}-${BUILD_SCM_REVISION}}" + git tag -a $RELEASE_TAG + git push --follow-tags + echo "release_tag=$RELEASE_TAG" >> $GITHUB_OUTPUT + |||, + }, { name: 'Create GitHub release and upload artifacts', uses: 'softprops/action-gh-release@v2', with: { make_latest: true, + tag_name: '${{ steps.create_tag.outputs.release_tag }}', files: ||| assets/* sha256