Skip to content

Commit 8bfc749

Browse files
authored
Merge pull request #3605 from tanem/release-via-action
Release via tanem/release-action
2 parents e8dbc4d + 58165b9 commit 8bfc749

7 files changed

Lines changed: 55 additions & 415 deletions

File tree

.github/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Categories for GitHub's generated release notes, keyed by the same labels the
2+
# release reads to derive the semver bump. `safe to test` authorises CI runs and
3+
# says nothing about the release, so it is excluded from both.
4+
changelog:
5+
exclude:
6+
labels:
7+
- safe to test
8+
categories:
9+
- title: 💥 Breaking Changes
10+
labels:
11+
- breaking
12+
- title: 🚀 Enhancements
13+
labels:
14+
- enhancement
15+
- title: 🛠 Everything Else
16+
labels:
17+
- '*'

.github/workflows/release.yml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,43 @@
11
name: Release
22

3+
# The filename is load-bearing: npm's trusted publisher for this package
4+
# matches on repo + workflow filename, so renaming this file means updating the
5+
# publisher first.
6+
37
on:
48
schedule:
59
- cron: '0 9 * * 1' # Every Monday at 9:00 AM UTC
610
workflow_dispatch:
711

8-
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref }}
10-
cancel-in-progress: false
11-
1212
permissions:
1313
contents: write
1414
id-token: write
15+
pull-requests: read
16+
17+
concurrency:
18+
group: ${{ github.workflow }}
1519

1620
jobs:
1721
release:
1822
runs-on: ubuntu-latest
23+
# The cron only ever fires on the default branch, but a manual dispatch can
24+
# target any branch. Without this guard, dispatching against a version
25+
# branch would bump, tag and publish that branch to npm as latest.
1926
if: github.ref == 'refs/heads/master'
2027

2128
steps:
22-
- name: Checkout code
23-
uses: actions/checkout@v6
29+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2430
with:
2531
fetch-depth: 0
26-
token: ${{ secrets.RELEASE_TOKEN }}
2732

28-
- name: Setup Node.js
29-
uses: actions/setup-node@v6
33+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
3034
with:
3135
node-version-file: '.nvmrc'
32-
cache: 'npm'
33-
registry-url: 'https://registry.npmjs.org'
34-
35-
- name: Configure git
36-
run: |
37-
git config user.name "github-actions[bot]"
38-
git config user.email "github-actions[bot]@users.noreply.github.com"
3936

40-
- name: Install dependencies
41-
run: npm ci
37+
# Load-bearing: this package has no prepublishOnly, so the dist/ that gets
38+
# published is the one `npm test` builds, and the tests gate the release.
39+
- run: npm ci
4240

43-
- name: Build
44-
run: npm run build
41+
- run: npm test
4542

46-
- name: Release
47-
run: npm run release
48-
env:
49-
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
- uses: tanem/release-action@29ffc8b4e3956c1b9532bfb2ad863f31953354a4 # v0.1.0

AGENTS.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ constrains belongs there, not here.
1717
subjects or PR titles. Write a plain capitalised sentence. Nothing reads the
1818
prefix: the version bump comes from the PR label, and renovate is set to
1919
`semanticCommits: "disabled"` to match.
20-
- PR titles are copied verbatim into `CHANGELOG.md`, so write them as the
21-
changelog line you want readers to see.
20+
- PR titles are copied verbatim into the generated release notes, so write them
21+
as the changelog line you want readers to see.
2222
- Hard-wrap commit message bodies at 72 columns; `git log` does not reflow
2323
them. Do not hard-wrap PR or issue descriptions: GitHub reflows markdown,
2424
and its web editor leaves wrapped source ragged once anyone edits it.
@@ -66,18 +66,23 @@ single version is run.
6666

6767
## Releases
6868

69-
`npm run release` runs on a Monday cron against `master`. It takes the version
70-
bump from the labels on PRs merged since the last tag, then regenerates
71-
`CHANGELOG.md` and `AUTHORS` and bumps `version` in `package.json` and
72-
`package-lock.json`.
69+
[`tanem/release-action`](https://github.com/tanem/release-action) runs on a
70+
Monday cron against `master`. It takes the version bump from the labels on PRs
71+
merged since the last tag, bumps `version` in `package.json` and
72+
`package-lock.json` through `npm version`, tags, then publishes the GitHub
73+
Release and the npm package.
7374

7475
- Exactly one label per PR. None, or more than one, throws and blocks the
7576
release for everything merged alongside it. `breaking` gives a major,
7677
`enhancement` a minor, `bug` / `documentation` / `internal` a patch. Tooling,
77-
CI and dependency work is `internal`.
78-
- Never hand-edit `CHANGELOG.md`, `AUTHORS` or either `version` field.
78+
CI and dependency work is `internal`. `safe to test` is ignored.
79+
- The changelog is
80+
[GitHub Releases](https://github.com/tanem/react-svg/releases), generated from
81+
those same labels via `.github/release.yml`. `CHANGELOG.md` is closed at
82+
v19.1.2 — nothing appends to it and nothing should, including you. `AUTHORS`
83+
is stale for the same reason. Never hand-edit either `version` field.
7984
- Breaking changes need a `MIGRATION.md` entry in the same PR: the generated
80-
changelog is only a list of PR titles.
85+
release notes are only a list of PR titles.
8186

8287
## Dependencies
8388

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
This file is frozen history: it covers releases up to and including v19.1.2, and
4+
is not regenerated any more. Everything released after that lives on
5+
[GitHub Releases](https://github.com/tanem/react-svg/releases).
6+
37
## [v19.1.2](https://github.com/tanem/react-svg/tree/v19.1.2) (2026-08-07)
48
[Full Changelog](https://github.com/tanem/react-svg/compare/v19.1.1...v19.1.2)
59

MIGRATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Migrating
22

3-
Details relating to major changes that aren't presently in `CHANGELOG.md`, due to limitations with how that file is being generated.
3+
Details relating to major changes that the release notes don't carry: those are generated from PR titles alone, so anything a reader needs beyond a one-line title lives here.
44

55
## v19.0.0
66

0 commit comments

Comments
 (0)