Compare commits

...

5 Commits

Author SHA1 Message Date
lukaszraczylo 72ef4441eb feat(go-release): add optional runner input (default ubuntu-latest)
Lets a caller run the release jobs on a self-hosted runner via with.runner,
e.g. runner: self-hosted. Defaults to ubuntu-latest so existing consumers are
unaffected.
2026-06-18 13:36:28 +01:00
lukaszraczylo a4cf065ea1 ci(goreleaser): commit build-time source changes into the tagged commit
Before tagging, fold any working-tree changes left by a repo-local workflow-prepare.sh (e.g. version stamping) into the tagged commit. Without this the tag captured the unstamped source AND GoReleaser's 'release --clean' failed on the dirty tree. The commit is reachable only via the tag (the branch is not pushed), so a 0.0.0-dev placeholder on main is preserved. No-op when the tree is clean, so repos that do not stamp are unaffected.
2026-05-30 13:09:30 +01:00
lukaszraczylo 58ab34e4cf ci: expose computed VERSION/VERSION_TAG to workflow-prepare.sh in release job
The release job now passes the calculated semver (bare VERSION and v-prefixed VERSION_TAG) into the repo-local workflow-prepare.sh hook's environment, so a consumer repo can stamp its version into source at build time. Needed for runtimes that cannot resolve their version from build info at runtime (e.g. Yaegi-interpreted Traefik plugins). Additive and backward-compatible: the test/version jobs run the hook without a version, and repos with no hook (or one that ignores VERSION) are unaffected.
2026-05-30 13:06:13 +01:00
lukaszraczylo fb34ae51e5 Revert "fixup! chore(goreleaser): pin sigstore/cosign-installer to v4.1.2"
This reverts commit cc643787c5.
2026-05-22 00:33:40 +01:00
lukaszraczylo cc643787c5 fixup! chore(goreleaser): pin sigstore/cosign-installer to v4.1.2 2026-05-22 00:22:12 +01:00
2 changed files with 28 additions and 3 deletions
+12
View File
@@ -33,6 +33,18 @@ runs:
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Fold any build-time source changes (e.g. version stamping by a
# repo-local workflow-prepare.sh) into the tagged commit. This is needed
# so consumers that fetch the tag's SOURCE — e.g. Yaegi-interpreted
# Traefik plugins, which Traefik never compiles — see the stamped value,
# and so GoReleaser's `release --clean` sees a clean working tree. The
# commit is reachable only via the tag; the branch is NOT advanced, so a
# source-tree placeholder (e.g. 0.0.0-dev on main) is preserved. No-op
# when the tree is already clean → unchanged for repos that don't stamp.
if ! git diff --quiet || ! git diff --cached --quiet; then
git add -A
git commit -m "chore(release): ${{ inputs.version-tag }}"
fi
git tag -a ${{ inputs.version-tag }} -m "Release ${{ inputs.version-tag }}" || true
if [[ "${{ inputs.mode }}" != "split" ]]; then
git push origin ${{ inputs.version-tag }} || true
+16 -3
View File
@@ -33,6 +33,11 @@ on:
required: false
type: boolean
default: false
runner:
description: "Runner label(s) for the release jobs. Defaults to ubuntu-latest; set to a self-hosted label (e.g. self-hosted) to run on your own runner."
required: false
type: string
default: "ubuntu-latest"
outputs:
version:
description: "The calculated version (without v prefix)"
@@ -44,7 +49,7 @@ on:
jobs:
test:
name: Test
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -67,7 +72,7 @@ jobs:
version:
name: Calculate Version
needs: test
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}
outputs:
version: ${{ steps.semver.outputs.version }}
version_tag: ${{ steps.semver.outputs.version_tag }}
@@ -96,7 +101,7 @@ jobs:
name: Release
needs: version
if: needs.version.outputs.version_tag != ''
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}
permissions:
contents: write
packages: write
@@ -109,6 +114,14 @@ jobs:
lfs: ${{ inputs.lfs }}
- name: Run workflow prepare script
# Expose the computed release version to a repo-local workflow-prepare.sh
# (e.g. to stamp the version into source for runtimes that cannot resolve
# it at build time, such as Yaegi-interpreted Traefik plugins). Only the
# release job has a version; the test/version jobs run the hook without
# it. VERSION is the bare semver (1.2.3); VERSION_TAG keeps the v prefix.
env:
VERSION: ${{ needs.version.outputs.version }}
VERSION_TAG: ${{ needs.version.outputs.version_tag }}
shell: bash
run: |
if [ -f "./workflow-prepare.sh" ]; then