Files
uberbringer/.gitea/workflows/release.yml
T
57_WolveandClaude Opus 5.5 853e8a9910
Security / Vulnerability check (push) Successful in 51s
Test / Lint and test (push) Successful in 2m0s
Build binaries only for release tags on main
Branch CI no longer runs the GoReleaser snapshot build. test.yml lints,
tests and runs `goreleaser check`, which validates the release config
without compiling; release.yml stays the only workflow that builds, and
only for v* tags whose commit is on main. `make check` mirrors this with a
release-check target, and `make snapshot` remains for local packaging
checks.

0.2.0 is not yet released, so its notes now say it ships under EUPL-1.2:
the licence entry moves into the 0.2.0 section, dated 2026-11-30, and
README states that releases up to 0.1.2 were published under AGPL-3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 00:15:58 -06:00

66 lines
2.2 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
jobs:
goreleaser:
name: Publish the release with GoReleaser
runs-on: ubuntu-latest
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# The runner's checkout does not reliably fetch tags, and goreleaser
# needs the previous tag to list the commits since it.
- name: Fetch tags
run: git fetch --force --tags
# Releases come from main only.
- name: Verify the tag is on main
run: |
git fetch origin +refs/heads/main:refs/remotes/origin/main
if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
echo "Tag $GITHUB_REF_NAME is not on main; refusing to release."
exit 1
fi
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# Releases are built with go.mod's toolchain line. setup-go@v5 installs
# the go line's release and the go command switches; fail if it did not.
- name: Check the Go toolchain
run: |
want="$(sed -n 's/^toolchain //p' go.mod)"
have="$(go env GOVERSION)"
echo "go.mod toolchain: ${want:-none}; running: $have"
[ "$have" = "$want" ]
# prerelease: auto in .goreleaser.yaml publishes vX.Y.Z-rc.N as a
# prerelease, so it never becomes the latest release.
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
# Pinned so that re-running a tag uses the same goreleaser. Same
# pin as the config check in test.yml.
version: '2.20.3'
args: release --clean
env:
GITEA_TOKEN: ${{ secrets.TOKEN_GITEA }}
GORELEASER_FORCE_TOKEN: gitea
# The tag that triggered this run. Left to itself, goreleaser takes
# the highest-sorting tag on the commit, and vX.Y.Z-rc.N sorts
# above vX.Y.Z.
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}
# Optional default Sentry DSN baked into release binaries.
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}