diff --git a/.github/workflows/release-major-tag.yml b/.github/workflows/release-major-tag.yml new file mode 100644 index 0000000..b2d044a --- /dev/null +++ b/.github/workflows/release-major-tag.yml @@ -0,0 +1,48 @@ +name: release major tag + +run-name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }} + +on: + workflow_dispatch: + inputs: + target: + description: The tag, branch, or SHA the major version should point to (e.g. v7.1.0) + required: true + major_version: + type: choice + description: The major version tag to move + options: + - v7 + - v6 + - v5 + - v4 + - v3 + - v2 + - v1 + +# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions +permissions: + contents: write + +jobs: + tag: + runs-on: ubuntu-latest + steps: + # Pin checkout a couple versions back so this workflow keeps working + # even if a botched release breaks the latest major. + - + name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + - + name: Git config + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + - + name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }} + run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }} + - + name: Push + run: git push origin ${{ github.event.inputs.major_version }} --force diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eaa00d6..bb87824 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,3 +72,18 @@ Use [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, - The `signing` CI job and `goreleaser-pro` matrix entries are skipped on PRs from forks because they need repository secrets — that's expected and not something you need to fix. + +## Releasing (maintainers) + +1. Create a new GitHub Release with a semver tag (e.g. `v7.1.0`) — either + through the UI or `gh release create v7.1.0 --generate-notes`. +2. Once the release exists, run the [**release major tag**](./.github/workflows/release-major-tag.yml) + workflow from the Actions tab: + - `target`: the new tag (e.g. `v7.1.0`) + - `major_version`: the major version to repoint (e.g. `v7`) + + This force-pushes the major tag to the new release so consumers using + `goreleaser/goreleaser-action@v7` pick up the change. + + The same workflow doubles as a rollback tool — pass an older tag as + `target` to revert the major.