Skip to content

Commit 9152a64

Browse files
authored
chore(tooling): setup release pipeline (#2342)
* chore(tooling): setup release pipeline * chore: add validate PR title workflow to enforce semantic commits * fix(pkg): use correct name for docs package
1 parent 3d2523d commit 9152a64

File tree

12 files changed

+113
-585
lines changed

12 files changed

+113
-585
lines changed

.changeset/config.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/bundle-size.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Bundle-size
33
on:
44
pull_request:
55
branches:
6-
- main
6+
- next
77

88
env:
99
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
@@ -31,7 +31,7 @@ jobs:
3131
run: yarn install --immutable
3232

3333
- name: Build packages
34-
run: yarn build --filter=!@react-spring/doc
34+
run: yarn build --filter=!@react-spring/docs
3535

3636
- uses: preactjs/compressed-size-action@v2
3737
with:

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Checks
33
on:
44
push:
55
branches:
6-
- 'main'
6+
- next
77
pull_request: {}
88

99
env:

.github/workflows/experimental.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: yarn install --immutable
3737

3838
- name: Build
39-
run: yarn build-ci
39+
run: yarn build:ci
4040

4141
- run: ./scripts/version-and-publish.sh
4242
env:

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262

6363
- name: Build
6464
if: steps.version.outputs.NEXT_VERSION
65-
run: yarn build-ci
65+
run: yarn build:ci
6666

6767
- name: Setup npmrc
6868
if: steps.version.outputs.NEXT_VERSION

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: Release Please
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
env:
14+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
15+
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref_name }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
release-please:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: googleapis/release-please-action@v4
26+
id: release
27+
28+
# Publish to NPM on new releases
29+
- uses: actions/checkout@v4
30+
if: ${{ steps.release.outputs.releases_created }}
31+
32+
- uses: actions/setup-node@v4
33+
if: ${{ steps.release.outputs.releases_created }}
34+
with:
35+
cache: yarn
36+
node-version: '20.x'
37+
registry-url: 'https://registry.npmjs.org'
38+
39+
- name: Install
40+
if: ${{ steps.release.outputs.releases_created }}
41+
run: yarn install --immutable
42+
43+
- name: Build
44+
if: ${{ steps.release.outputs.releases_created }}
45+
run: yarn build:ci
46+
47+
# Release Please has already incremented versions and published tags, so we just
48+
# need to publish all unpublished versions to NPM here
49+
- run: yarn workspaces foreach npm publish --access=public
50+
if: ${{ steps.release.outputs.releases_created }}
51+
env:
52+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Tests
33
on:
44
push:
55
branches:
6-
- 'main'
6+
- next
77
pull_request: {}
88

99
env:
@@ -57,7 +57,7 @@ jobs:
5757
run: yarn install --immutable
5858

5959
- name: Build
60-
run: yarn build-ci --filter=!@react-spring/docs
60+
run: yarn build:ci
6161

6262
- name: Pack
6363
run: yarn package
@@ -115,7 +115,7 @@ jobs:
115115
run: yarn install --immutable
116116

117117
- name: Build
118-
run: yarn build-ci
118+
run: yarn build:ci
119119

120120
- name: Test
121121
run: yarn test:unit
@@ -147,7 +147,7 @@ jobs:
147147
run: yarn add typescript@${{ matrix.ts }}
148148

149149
- name: Build
150-
run: yarn build-ci
150+
run: yarn build:ci
151151

152152
- name: Test
153153
run: |
@@ -177,7 +177,7 @@ jobs:
177177
# run: yarn install --immutable
178178

179179
# - name: Build
180-
# run: yarn build-ci
180+
# run: yarn build:ci
181181

182182
# - name: Test
183183
# run: yarn test:e2e

.github/workflows/validate-pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: "Validate PR"
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
pull-requests: read
8+
9+
jobs:
10+
main:
11+
name: Validate PR title
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -20,74 +20,3 @@ Be sure your commit messages follow this specification: https://www.conventional
2020
### Windows permission errors
2121

2222
Some Windows users may need to [enable developer mode](https://howtogeek.com/292914/what-is-developer-mode-in-windows-10) if experiencing `EPERM: operation not permitted, symlink` with Preconstruct. If this persists, you might be running on an unsupported drive/format. In which case, consider using [Docker](https://docs.docker.com/docker-for-windows).
23-
24-
### Duplicate `react` errors
25-
26-
React 16.8+ has global state to support its "hooks" feature, so you need to ensure only one copy of `react` exists in your program. Otherwise, you'll most likely see [this error](https://reactjs.org/warnings/invalid-hook-call-warning.html). Please try the following solutions, and let us know if it still doesn't work for you.
27-
28-
- **For `create-react-app` users:** Follow this guide: https://github.com/facebook/react/issues/13991#issuecomment-496383268
29-
30-
- **For `webpack` users:** Add an alias to `webpack.config.js` like this:
31-
32-
```js
33-
alias: {
34-
react: path.resolve('node_modules/react'),
35-
}
36-
```
37-
38-
- **For `gatsby` users:** Install `gatsby-plugin-alias-imports` and add this to your `gatsby-config.js` module:
39-
```js
40-
{
41-
resolve: `gatsby-plugin-alias-imports`,
42-
options: {
43-
alias: {
44-
react: path.resolve('node_modules/react'),
45-
},
46-
},
47-
},
48-
```
49-
50-
# Publishing
51-
52-
We use [`changesets`](https://github.com/atlassian/changesets) to publish our package now.
53-
All our dependencies are fixed using ~ after [1414](https://github.com/pmndrs/react-spring/issues/1414) but luckily changesets will bump them for every minor version we release.
54-
55-
## Simple release
56-
57-
You want to release some new features that haven't been released yet:
58-
59-
```shell
60-
yarn changeset:add
61-
```
62-
63-
Follow the prompt to flag which packages need to update although with `react-spring` we keep all our packages at the same version.
64-
65-
Then you'll run:
66-
67-
```shell
68-
yarn vers
69-
```
70-
71-
This will update all the packages correctly according to what version you just set with the `add` script & possibly update the deps within those packages.
72-
73-
Finally:
74-
75-
```shell
76-
yarn release
77-
```
78-
79-
This will build the packages, publish them & push the tags to github to signify a new release. Please then update the `releases` on github & the changelog on `react-spring.io`
80-
81-
## Prerelease
82-
83-
Everything above applies but you must first run:
84-
85-
```shell
86-
yarn changeset pre enter beta | alpha | next
87-
```
88-
89-
If you find you're stuck in a prerelease and trying to do a Simple Release, try running:
90-
91-
```shell
92-
yarn changeset pre exit
93-
```

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
]
3131
},
3232
"scripts": {
33-
"build-ci": "turbo run build --filter=!@react-spring/doc",
33+
"build:ci": "turbo run build --filter=!@react-spring/docs",
3434
"build": "turbo run build",
3535
"changeset": "changeset",
3636
"clean": "turbo run clean",
@@ -48,9 +48,7 @@
4848
"test:unit": "jest",
4949
"test:cov": "jest --coverage",
5050
"test:ts": "tsc --noEmit",
51-
"test:e2e": "start-server-and-test 'yarn vite serve packages/parallax/test --host' http-get://localhost:3000 'yarn cypress run'",
52-
"release": "yarn clean && yarn && yarn build && yarn test:ts && yarn test:unit && yarn changeset publish --no-git-tag",
53-
"vers": "yarn changeset version"
51+
"test:e2e": "start-server-and-test 'yarn vite serve packages/parallax/test --host' http-get://localhost:3000 'yarn cypress run'"
5452
},
5553
"commitlint": {
5654
"extends": [
@@ -63,7 +61,6 @@
6361
}
6462
},
6563
"devDependencies": {
66-
"@changesets/cli": "2.27.9",
6764
"@commitlint/cli": "19.5.0",
6865
"@commitlint/config-conventional": "19.5.0",
6966
"@react-three/fiber": "8.17.10",

0 commit comments

Comments
 (0)