Skip to content

Commit 5e53f8e

Browse files
caarlos0Copilot
andauthored
ci: add release-major-tag workflow (#552)
* build: drop docker-bake in favor of plain npm Every TypeScript action maintained by actions/* (checkout, setup-node, setup-go, cache, upload-artifact) uses plain npm scripts. The bake setup is a docker/* org convention and adds friction for TS work: contributors need Docker, the dev loop is ~10x slower than npm, and Alpine-vs-host byte drift in dist/index.js makes PRs bounce. Replace with the standard pattern: - .node-version pins Node 24 so contributors and CI agree - npm scripts (build, lint, format, test, pre-checkin) replace bake targets one-for-one - validate.yml runs lint + a check-dist diff (mirrors actions/setup-node) and a vendor check that npm install --package-lock-only is a no-op - test.yml uses setup-node + sigstore/cosign-installer, drops bake-action - dependabot-build.yml regenerates dist via npm instead of bake CONTRIBUTING.md and README development section updated to match. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * build: align scripts and workflows with actions/* convention Match the standard layout used by actions/checkout, actions/setup-node, etc.: - package.json scripts: split format/format-check (Prettier) from lint/lint:fix (ESLint), and have pre-checkin run all four (format, lint:fix, build, test) in that order. - validate.yml lint job runs format-check + lint as separate steps. - test.yml drops the redundant --coverage flag (now in the test script). - Drop dependabot-build.yml: actions/* don't auto-rebuild dist on dependabot PRs; the check-dist style validate / build job catches drift and a maintainer rebuilds locally if needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: add release-major-tag workflow Adopts the actions/checkout pattern (workflow_dispatch with target + major_version inputs that force-pushes the major tag). Doubles as a rollback tool. Documented in CONTRIBUTING under a 'Releasing' section. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: drop irrelevant pin comment from release-major-tag Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4068afa commit 5e53f8e

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: release major tag
2+
3+
run-name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }}
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
target:
9+
description: The tag, branch, or SHA the major version should point to (e.g. v7.1.0)
10+
required: true
11+
major_version:
12+
type: choice
13+
description: The major version tag to move
14+
options:
15+
- v7
16+
- v6
17+
- v5
18+
- v4
19+
- v3
20+
- v2
21+
- v1
22+
23+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
24+
permissions:
25+
contents: write
26+
27+
jobs:
28+
tag:
29+
runs-on: ubuntu-latest
30+
steps:
31+
-
32+
name: Checkout
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
with:
35+
fetch-depth: 0
36+
-
37+
name: Git config
38+
run: |
39+
git config user.name "github-actions[bot]"
40+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
41+
-
42+
name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }}
43+
run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }}
44+
-
45+
name: Push
46+
run: git push origin ${{ github.event.inputs.major_version }} --force

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,18 @@ Use [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`,
7272
- The `signing` CI job and `goreleaser-pro` matrix entries are skipped on PRs
7373
from forks because they need repository secrets — that's expected and not
7474
something you need to fix.
75+
76+
## Releasing (maintainers)
77+
78+
1. Create a new GitHub Release with a semver tag (e.g. `v7.1.0`) — either
79+
through the UI or `gh release create v7.1.0 --generate-notes`.
80+
2. Once the release exists, run the [**release major tag**](./.github/workflows/release-major-tag.yml)
81+
workflow from the Actions tab:
82+
- `target`: the new tag (e.g. `v7.1.0`)
83+
- `major_version`: the major version to repoint (e.g. `v7`)
84+
85+
This force-pushes the major tag to the new release so consumers using
86+
`goreleaser/goreleaser-action@v7` pick up the change.
87+
88+
The same workflow doubles as a rollback tool — pass an older tag as
89+
`target` to revert the major.

0 commit comments

Comments
 (0)