chore(release): 0.9.6 #26
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write # create the GitHub Release | |
| packages: write # push the Docker image to GHCR | |
| id-token: write # cosign keyless signing (Sigstore OIDC) | |
| jobs: | |
| goreleaser: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - uses: docker/setup-buildx-action@v4 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: sigstore/cosign-installer@v3 | |
| - uses: anchore/sbom-action/download-syft@v0 | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| version: '~> v2' | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} | |
| # Releases are tagged on `develop`; keep `main` (the default branch) pointing | |
| # at the released commit so it never falls behind a published release. | |
| # Fast-forward only — fails loudly if main has diverged. Skips pre-releases. | |
| - name: Promote main to the released commit | |
| if: ${{ !contains(github.ref_name, '-') }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git fetch origin main | |
| if git merge-base --is-ancestor origin/main HEAD; then | |
| git push origin "HEAD:refs/heads/main" | |
| echo "Fast-forwarded main to ${GITHUB_REF_NAME}" | |
| else | |
| echo "::error::main is not an ancestor of ${GITHUB_REF_NAME}; cannot fast-forward — promote main manually." | |
| exit 1 | |
| fi |