From cc643787c5c675092cceabc5efb144c71b0b0abc Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Fri, 22 May 2026 00:22:12 +0100 Subject: [PATCH] fixup! chore(goreleaser): pin sigstore/cosign-installer to v4.1.2 --- .github/actions/semver/action.yml | 49 ++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/.github/actions/semver/action.yml b/.github/actions/semver/action.yml index 9669ea5..0403e72 100644 --- a/.github/actions/semver/action.yml +++ b/.github/actions/semver/action.yml @@ -1,11 +1,19 @@ name: "Semantic Version" -description: "Calculate semantic version using semver-generator" +description: "Calculate semantic version using semver-generator (built from source to avoid Docker :latest bootstrap loop)" inputs: config-file: description: "Path to semver config file" required: false default: "semver.yaml" + semver-version: + description: "Ref of lukaszraczylo/semver-generator to install (branch, tag, or commit SHA)" + required: false + default: "main" + go-version: + description: "Go version to use when installing semver-generator" + required: false + default: ">=1.24" outputs: version: @@ -18,18 +26,43 @@ outputs: runs: using: "composite" steps: + - name: Setup Go + uses: actions/setup-go@v6 + with: + go-version: ${{ inputs.go-version }} + + - name: Install semver-generator from source + shell: bash + env: + SEMVER_REF: ${{ inputs.semver-version }} + run: | + set -euo pipefail + # GOPROXY=direct avoids stale module-proxy cache when SEMVER_REF + # points to a commit that was just pushed (e.g. semver-generator + # bootstrapping its own release). + GOPROXY=direct GOFLAGS=-mod=mod \ + go install "github.com/lukaszraczylo/semver-generator@${SEMVER_REF}" + echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" + - name: Calculate version id: semver - uses: lukaszraczylo/semver-generator@v1 - with: - config_file: ${{ inputs.config-file }} - repository_local: true + shell: bash + env: + CONFIG_FILE: ${{ inputs.config-file }} + run: | + set -euo pipefail + OUT=$(semver-generator generate -l -c "${CONFIG_FILE}") + echo "${OUT}" + VERSION=$(printf '%s\n' "${OUT}" | sed -e 's|SEMVER ||g' | tr -d '[:space:]') + echo "semantic_version=${VERSION}" >> "$GITHUB_OUTPUT" - name: Format version id: format shell: bash + env: + VERSION: ${{ steps.semver.outputs.semantic_version }} run: | - VERSION="${{ steps.semver.outputs.semantic_version }}" - echo "version=${VERSION}" >> $GITHUB_OUTPUT - echo "version_tag=v${VERSION}" >> $GITHUB_OUTPUT + set -euo pipefail + echo "version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version_tag=v${VERSION}" >> "$GITHUB_OUTPUT" echo "Version: v${VERSION}"