Skip to content

Commit 6b19a26

Browse files
committed
chore: adopt release-please for automated releases
1 parent a763145 commit 6b19a26

File tree

5 files changed

+66
-24
lines changed

5 files changed

+66
-24
lines changed

.github/workflows/publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
registry-url: 'https://registry.npmjs.org'
20+
21+
- name: Upgrade npm for OIDC support
22+
run: npm install -g npm@latest
23+
24+
- run: yarn install --immutable
25+
26+
- run: yarn prepare
27+
28+
- run: npm publish --provenance --access public ${{ github.event.release.prerelease && '--tag next' || ''}}
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@v4
17+
with:
18+
token: ${{ secrets.PAT_GITHUB }}
19+
config-file: release-please-config.json
20+
manifest-file: .release-please-manifest.json

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "9.7.1"
3+
}

package.json

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"typescript": "tsc --noEmit",
3434
"lint": "eslint \"**/*.{js,ts,tsx}\"",
3535
"prepare": "bob build",
36-
"release": "release-it",
3736
"example": "yarn --cwd example",
3837
"pods": "cd example && pod-install --quiet",
3938
"bootstrap": "yarn example && yarn && yarn pods"
@@ -56,7 +55,6 @@
5655
"devDependencies": {
5756
"@commitlint/config-conventional": "^19.5.0",
5857
"@react-native/eslint-config": "^0.73.1",
59-
"@release-it/conventional-changelog": "^9.0.2",
6058
"@types/jest": "^29.5.14",
6159
"@types/react": "~18.3.12",
6260
"@types/react-native": "0.72.2",
@@ -70,7 +68,6 @@
7068
"pod-install": "^0.1.0",
7169
"prettier": "^3.0.3",
7270
"react-native-builder-bob": "^0.20.4",
73-
"release-it": "^17.10.0",
7471
"typescript": "^5.2.2"
7572
},
7673
"peerDependencies": {
@@ -81,33 +78,13 @@
8178
"node": ">=16"
8279
},
8380
"resolutions": {
84-
"@types/react": "^18.2.44",
85-
"conventional-changelog-conventionalcommits": "8.0.0"
81+
"@types/react": "^18.2.44"
8682
},
8783
"commitlint": {
8884
"extends": [
8985
"@commitlint/config-conventional"
9086
]
9187
},
92-
"release-it": {
93-
"git": {
94-
"commitMessage": "chore: release ${version}",
95-
"tagName": "v${version}"
96-
},
97-
"npm": {
98-
"publish": true
99-
},
100-
"github": {
101-
"release": true
102-
},
103-
"plugins": {
104-
"@release-it/conventional-changelog": {
105-
"preset": {
106-
"name": "conventionalcommits"
107-
}
108-
}
109-
}
110-
},
11188
"eslintConfig": {
11289
"root": true,
11390
"extends": [

release-please-config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "node",
4+
"bump-minor-pre-major": true,
5+
"bump-patch-for-minor-pre-major": true,
6+
"packages": {
7+
".": {
8+
"changelog-path": "CHANGELOG.md",
9+
"include-component-in-tag": false
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)