Skip to content

Commit 4841592

Browse files
committed
feat!: require Node 24 only, update Actions to latest, fix release ordering
Narrows runtime support to the current LTS instead of maintaining a matrix of older ones: Node 22 is not EOL, this is a deliberate policy choice, not a forced one. Bumps engines.node to >=24 and the CI matrix to a single Node 24 job (was 22+24, with three other jobs individually pinned to 22 as well). actions/checkout and actions/setup-node go from @v4 to @v7 in both workflows. @v4 pins its own internal JS runtime to Node 20, which GitHub is deprecating (EOL April 2026, runners default to Node 24 from June 2026, full removal fall 2026) -- unrelated to this project's own node-version input, but every @v4 consumer gets the warning regardless. @v5+ moved the action's own runtime to Node 24. Also fixes a real defect the last release run just hit: "Tag and publish" created and pushed the v3.0.0 tag BEFORE attempting the npm publish, which failed. That left a tag with nothing behind it, which then permanently blocks every future retry -- the check job's "does this tag exist" test reports the version as already released, so the pipeline no-ops without ever attempting the publish again. Publish now runs before tagging, so a failed publish never leaves a dangling tag. Also adds an explicit `npm whoami` step before publish, since a bad NPM_TOKEN otherwise surfaces only as an opaque "exit code 1" -- and per actions/setup-node#1551, setup-node writes an _authToken line to .npmrc even when the token is empty, which makes npm treat auth as "already configured" and skip OIDC discovery rather than falling back to it. The stale v3.0.0 tag from the failed run is deleted (locally and on origin) so the next attempt starts clean.
1 parent a99dc88 commit 4841592

5 files changed

Lines changed: 76 additions & 48 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
node: ['22', '24']
24+
node: ['24']
2525

2626
steps:
27-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@v7
2828
with:
2929
persist-credentials: false
3030

31-
- uses: actions/setup-node@v4
31+
- uses: actions/setup-node@v7
3232
with:
3333
node-version: ${{ matrix.node }}
3434
cache: npm
@@ -50,13 +50,13 @@ jobs:
5050
name: Dependency audit
5151
runs-on: ubuntu-latest
5252
steps:
53-
- uses: actions/checkout@v4
53+
- uses: actions/checkout@v7
5454
with:
5555
persist-credentials: false
5656

57-
- uses: actions/setup-node@v4
57+
- uses: actions/setup-node@v7
5858
with:
59-
node-version: '22'
59+
node-version: '24'
6060
cache: npm
6161

6262
- run: npm ci
@@ -73,13 +73,13 @@ jobs:
7373
name: Verify publishable tarball
7474
runs-on: ubuntu-latest
7575
steps:
76-
- uses: actions/checkout@v4
76+
- uses: actions/checkout@v7
7777
with:
7878
persist-credentials: false
7979

80-
- uses: actions/setup-node@v4
80+
- uses: actions/setup-node@v7
8181
with:
82-
node-version: '22'
82+
node-version: '24'
8383
cache: npm
8484

8585
- run: npm ci
@@ -135,13 +135,13 @@ jobs:
135135
--health-interval=5s --health-timeout=5s --health-retries=20
136136
137137
steps:
138-
- uses: actions/checkout@v4
138+
- uses: actions/checkout@v7
139139
with:
140140
persist-credentials: false
141141

142-
- uses: actions/setup-node@v4
142+
- uses: actions/setup-node@v7
143143
with:
144-
node-version: '22'
144+
node-version: '24'
145145
cache: npm
146146

147147
- run: npm ci

‎.github/workflows/release.yml‎

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ name: Release
22

33
# Releases are driven by the version field in package.json, not by tagging
44
# manually. When this workflow is run, if package.json carries a version that
5-
# has no matching git tag yet, that version is tested, tagged, published to npm
6-
# with provenance, and given a GitHub Release.
5+
# has no matching git tag yet, that version is tested, published to npm with
6+
# provenance, tagged, and given a GitHub Release — in that order. Publish runs
7+
# BEFORE tagging deliberately: if publish fails, nothing is left dangling. A
8+
# tag created before a failed publish blocks every retry afterward, because the
9+
# next run's "does this tag already exist" check reports the version as
10+
# already released when it never actually reached npm.
711
#
812
# It is currently triggered manually only (see the `on:` block below).
913
#
@@ -40,7 +44,7 @@ jobs:
4044
version: ${{ steps.version.outputs.version }}
4145
tag: ${{ steps.version.outputs.tag }}
4246
steps:
43-
- uses: actions/checkout@v4
47+
- uses: actions/checkout@v7
4448
with:
4549
# Tags are needed to tell an already-released version from a new one.
4650
fetch-depth: 0
@@ -77,11 +81,11 @@ jobs:
7781
if: needs.check.outputs.should_release == 'true'
7882
runs-on: ubuntu-latest
7983
steps:
80-
- uses: actions/checkout@v4
84+
- uses: actions/checkout@v7
8185
with:
8286
persist-credentials: false
8387

84-
- uses: actions/setup-node@v4
88+
- uses: actions/setup-node@v7
8589
with:
8690
node-version: '24'
8791
cache: npm
@@ -118,47 +122,66 @@ jobs:
118122
contents: write # push the tag, create the GitHub Release
119123
id-token: write # OIDC: authenticates to npm AND signs provenance
120124
steps:
121-
- uses: actions/checkout@v4
125+
- uses: actions/checkout@v7
122126

123-
- uses: actions/setup-node@v4
127+
- uses: actions/setup-node@v7
124128
with:
125129
node-version: '24'
126130
registry-url: https://registry.npmjs.org
127131
cache: npm
128132

129133
- run: npm ci
130134

131-
- name: Create and push the tag
135+
# A wrong or missing NPM_TOKEN otherwise surfaces as a bare "exit code 1"
136+
# on the publish step with no further detail. This turns that into a
137+
# readable auth error before anything else runs. It also catches a known
138+
# actions/setup-node footgun (actions/setup-node#1551): when
139+
# registry-url is set, setup-node always writes an _authToken line to
140+
# .npmrc — even an EMPTY one if NODE_AUTH_TOKEN isn't set — and npm treats
141+
# that as "token auth is configured," skipping OIDC discovery entirely
142+
# rather than falling back to it. whoami fails clearly in that case too.
143+
- name: Verify npm authentication
144+
run: npm whoami
132145
env:
133-
TAG: ${{ needs.check.outputs.tag }}
134-
run: |
135-
git config user.name "github-actions[bot]"
136-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
137-
git tag -a "$TAG" -m "$TAG"
138-
git push origin "$TAG"
146+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
139147

140-
# Auth is OIDC (npm Trusted Publishing): the npm CLI detects an OIDC
141-
# environment and uses it before falling back to a token, so no long-lived
142-
# credential is needed. Requires id-token: write above, npm >= 11.5.1 and
143-
# Node >= 22.14.0 (the Node 24 pinned above satisfies both).
148+
# Auth is OIDC (npm Trusted Publishing) once configured: the npm CLI
149+
# detects an OIDC environment and uses it before falling back to a token,
150+
# so no long-lived credential is needed. Requires id-token: write above,
151+
# npm >= 11.5.1 and Node >= 22.14.0 (the Node 24 pinned above satisfies
152+
# both).
144153
#
145154
# --provenance attaches a signed, publicly verifiable attestation linking
146-
# the tarball to this exact commit, workflow, and runner.
155+
# the tarball to this exact commit, workflow, and runner. This works
156+
# independently of Trusted Publishing — it only needs id-token: write and
157+
# a supported CI provider, so it is available on the very first publish.
147158
#
148-
# ONE-TIME BOOTSTRAP. npm cannot publish a package's *first* version over
149-
# OIDC: trusted publishing is configured on a package's settings page, and
150-
# that page does not exist until the package does. PyPI allows
151-
# pre-registration; npm does not. So for the very first release of a new
152-
# name, either publish once locally (`npm publish --access public`) or set
153-
# NPM_TOKEN, then configure the trusted publisher at
159+
# ONE-TIME BOOTSTRAP for Trusted Publishing specifically (not for
160+
# provenance, which works today). npm cannot publish a package's *first*
161+
# version over OIDC auth: trusted publishing is configured on a package's
162+
# settings page, and that page does not exist until the package does.
163+
# PyPI allows pre-registration; npm does not
164+
# (https://github.com/npm/cli/issues/8544). So for the very first release
165+
# of a new name, NPM_TOKEN carries auth; once the package exists, you can
166+
# configure the trusted publisher at
154167
# npmjs.com > package > Settings > Trusted Publisher -> this repo + release.yml
155-
# and delete the secret. NODE_AUTH_TOKEN below exists only for that first
156-
# publish and is ignored once trusted publishing is live.
168+
# and delete the secret. NODE_AUTH_TOKEN below is then simply unused.
157169
- name: Publish to npm
158170
run: npm publish --provenance --access public
159171
env:
160172
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
161173

174+
# Only reached after a successful publish, so a failure above never
175+
# leaves a tag with nothing published behind it.
176+
- name: Create and push the tag
177+
env:
178+
TAG: ${{ needs.check.outputs.tag }}
179+
run: |
180+
git config user.name "github-actions[bot]"
181+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
182+
git tag -a "$TAG" -m "$TAG"
183+
git push origin "$TAG"
184+
162185
- name: Create GitHub Release
163186
env:
164187
GH_TOKEN: ${{ github.token }}

‎CHANGELOG.md‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ All notable changes to this project are documented here. This project follows
88
Security release. The analytics read endpoints now require authentication, so
99
**upgrading from 2.x is a breaking change**: set `READ_API_KEYS` and send an
1010
`x-api-key` header, set `CORS_ORIGINS`, replace any use of `GET /ip`, and run on
11-
Node 22 or newer.
11+
Node 24 or newer.
1212

1313
### Added
1414

@@ -52,8 +52,9 @@ Node 22 or newer.
5252
new module. Test count 61 → 340; coverage floor raised from 50% to 85%/75%
5353
and is build-breaking.
5454
- ESLint with the error-handling rules, wired into `npm test`.
55-
- CI (Node 22/24, lint, audit, tarball check) and a release workflow that
56-
tags and publishes each new `package.json` version to npm with provenance.
55+
- CI (Node 24, lint, audit, tarball check, real-MySQL E2E) and a release
56+
workflow that publishes each new `package.json` version to npm with
57+
provenance.
5758
- `ALLOWED_APP_IDS` and `ALLOWED_DEVICE_SIZES` environment variables.
5859
- Full icon set and `scripts/generate-brand-assets.js`.
5960

@@ -148,9 +149,12 @@ Node 22 or newer.
148149
### Removed
149150

150151
- `GET /ip`.
151-
- Support for Node 20; the minimum is now Node 22. Node 20 reached end of life
152-
in April 2026 and no longer receives security patches. Dropping a runtime is a
153-
breaking change and belongs in a major release, and this is that release.
152+
- Support for Node 20 and Node 22; the minimum is now Node 24. Node 20 reached
153+
end of life in April 2026 and no longer receives security patches. Node 22 is
154+
still supported upstream, but this project tracks only the current LTS rather
155+
than maintaining a matrix of older runtimes — a decision, not an EOL forced
156+
by anything about 22 itself. Dropping a runtime is a breaking change and
157+
belongs in a major release, and this is that release.
154158
- `docs/favicon.png`, superseded by `favicon.ico` and the `icon-*.png` set.
155159

156160
## [2.0.0]

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ We believe in total transparency regarding your visitors' data:
5757

5858
## Quick Start
5959

60-
**Requires Node 22 or newer** and a reachable MySQL 8 (or MariaDB 11) instance.
61-
Node 20 is not supported: it reached end of life in April 2026.
60+
**Requires Node 24 or newer** and a reachable MySQL 8 (or MariaDB 11) instance.
61+
Only the current Node LTS is supported — no matrix of older runtimes to
62+
maintain.
6263

6364
### 1. Install Dependencies
6465
```bash

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "3.0.0",
55
"main": "index.js",
66
"engines": {
7-
"node": ">=22"
7+
"node": ">=24"
88
},
99
"files": [
1010
"index.js",

0 commit comments

Comments
 (0)