Skip to content

docs(changelog): the guard's two exemptions are one entry, with the c… #13

docs(changelog): the guard's two exemptions are one entry, with the c…

docs(changelog): the guard's two exemptions are one entry, with the c… #13

Workflow file for this run

name: Release
on:
push:
tags: ['v*']
# GoReleaser creates the GitHub Release and uploads the archives/checksums.
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
# Full history and tags: goreleaser derives the version from the tag and
# builds the changelog from the commits since the previous one, so a
# shallow clone would produce a wrong version and an empty changelog.
# persist-credentials: false — this job escalates to `contents: write`,
# and checkout otherwise leaves that token in .git/config for the rest of
# the job, including while the third-party goreleaser action runs.
# goreleaser only reads the local history and authenticates to the API
# via the GITHUB_TOKEN env below, so it never needs the git credential.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version: '1.25'
cache: true
# The release body is CHANGELOG.md's section for this tag plus a
# Contributors line computed from `git log` — never goreleaser's own
# commit-subject list. v0.8.0 shipped that list and it was six SHAs, with
# the headline of the release (this project's first outside contribution)
# sitting as one unattributed line among them.
#
# This step FAILS the release when the section is missing, and that is
# deliberate: a tag with no written notes should not become a release
# people can install. `TestChangelogSectionHasSubstance` catches the same
# thing one step earlier, in the release PR.
- name: build release notes
run: scripts/release-notes.sh "${GITHUB_REF_NAME}" > "${RUNNER_TEMP}/release-notes.md"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
- name: goreleaser release
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
with:
# Matches `version: 2` in .goreleaser.yaml.
version: '~> v2'
args: release --clean --release-notes=${{ runner.temp }}/release-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}