Skip to content

Commit 7a6545f

Browse files
authored
chore: add release PR workflow and npm provenance (#2434)
* chore: add release PR workflow and npm provenance Adds a changesets-driven Release workflow that opens a "Version Packages" PR on `next` and publishes when the PR is merged, with every tarball signed via npm Trusted Publishing (OIDC, no NPM_TOKEN). Also attaches SLSA provenance to the existing nightly and experimental publishes via id-token: write + NPM_CONFIG_PROVENANCE=true, fixes the stale baseBranch in .changeset/config.json (main -> next), and enables @changesets/changelog-github so release PR bodies link back to source PRs. * chore: allow release workflow to be triggered manually * chore: drop redundant test gates from release workflow Tests already pass on the PR via tests.yml before merge to next, so re-running them on the release path just adds latency. * chore: align release workflow with Node 22 + actions v6
1 parent a115ae4 commit 7a6545f

19 files changed

Lines changed: 163 additions & 2 deletions

File tree

.changeset/config.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{
22
"$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json",
3-
"changelog": false,
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{ "repo": "pmndrs/react-spring" }
6+
],
47
"commit": false,
58
"fixed": [["@react-spring/*"]],
69
"linked": [],
710
"access": "public",
8-
"baseBranch": "main",
11+
"baseBranch": "next",
912
"updateInternalDependencies": "patch",
1013
"ignore": ["@react-spring/demo", "@react-spring/docs"]
1114
}

.github/workflows/experimental.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616
name: 'Experimental Release'
1717
if: github.repository == 'pmndrs/react-spring'
1818
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
id-token: write
1922
steps:
2023
- name: Cancel Previous Runs
2124
uses: styfle/cancel-workflow-action@0.12.1

.github/workflows/nightly.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
name: 'Nightly Release'
1818
if: github.repository == 'pmndrs/react-spring'
1919
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
id-token: write
2023
outputs:
2124
NEXT_VERSION: ${{ steps.version.outputs.NEXT_VERSION }}
2225
steps:

.github/workflows/release.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- 'next'
7+
workflow_dispatch:
8+
9+
env:
10+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
11+
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref_name }}
15+
cancel-in-progress: false
16+
17+
permissions: {}
18+
19+
jobs:
20+
release:
21+
name: 'Release'
22+
if: github.repository == 'pmndrs/react-spring'
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: write
26+
pull-requests: write
27+
id-token: write
28+
steps:
29+
- name: Checkout repo
30+
uses: actions/checkout@v6
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Setup pnpm
35+
uses: pnpm/action-setup@v4
36+
37+
- name: Setup node
38+
uses: actions/setup-node@v6
39+
with:
40+
node-version-file: '.nvmrc'
41+
cache: 'pnpm'
42+
registry-url: 'https://registry.npmjs.org'
43+
44+
# npm Trusted Publishing requires npm >= 11.5.1; Node 22 LTS still ships npm 10.x
45+
- name: Upgrade npm
46+
run: npm install -g npm@latest
47+
48+
- name: Install
49+
run: pnpm install --frozen-lockfile
50+
51+
- name: Build
52+
run: pnpm build-ci
53+
54+
- name: Create release PR or publish
55+
uses: changesets/action@v1
56+
with:
57+
version: pnpm vers
58+
publish: pnpm changeset publish
59+
title: 'chore: version packages'
60+
commit: 'chore: version packages'
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
}
5858
},
5959
"devDependencies": {
60+
"@changesets/changelog-github": "^0.7.0",
6061
"@changesets/cli": "2.27.11",
6162
"@commitlint/cli": "19.6.1",
6263
"@commitlint/config-conventional": "19.6.0",

packages/animated/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
"maintainers": [
4545
"Josh Ellis (https://github.com/joshuaellis)"
4646
],
47+
"publishConfig": {
48+
"provenance": true
49+
},
4750
"scripts": {
4851
"build": "tsup",
4952
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",

packages/core/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
"maintainers": [
4848
"Josh Ellis (https://github.com/joshuaellis)"
4949
],
50+
"publishConfig": {
51+
"provenance": true
52+
},
5053
"scripts": {
5154
"build": "tsup",
5255
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",

packages/parallax/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
"maintainers": [
4444
"Josh Ellis (https://github.com/joshuaellis)"
4545
],
46+
"publishConfig": {
47+
"provenance": true
48+
},
4649
"scripts": {
4750
"build": "tsup",
4851
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",

packages/rafz/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
],
4242
"license": "MIT",
4343
"author": "Josh Ellis",
44+
"publishConfig": {
45+
"provenance": true
46+
},
4447
"scripts": {
4548
"build": "tsup",
4649
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",

packages/react-spring/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
"maintainers": [
4444
"Josh Ellis (https://github.com/joshuaellis)"
4545
],
46+
"publishConfig": {
47+
"provenance": true
48+
},
4649
"dependencies": {
4750
"@react-spring/core": "~10.0.3",
4851
"@react-spring/konva": "~10.0.3",

0 commit comments

Comments
 (0)