Skip to content

Commit 08a6081

Browse files
chore: switch from np to release-it, add GHA workflow (#18)
We encountered issues with `np` when trying to release to today, it has no CI mode, and is not very maintained anymore
1 parent 67bd858 commit 08a6081

5 files changed

Lines changed: 1021 additions & 1321 deletions

File tree

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
increment:
5+
type: choice
6+
options:
7+
- major
8+
- minor
9+
- patch
10+
11+
jobs:
12+
release:
13+
name: 🚀 Release
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 15
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup node
22+
id: setup-node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version-file: ".nvmrc"
26+
27+
- name: git config
28+
run: |
29+
git config user.name "${GITHUB_ACTOR}"
30+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
31+
32+
- name: Install dependencies
33+
run: yarn --frozen-lockfile
34+
35+
- name: Release
36+
run: yarn release-it ${{ inputs.increment }}
37+
env:
38+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

.release-it.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/release-it@18/schema/release-it.json",
3+
"git": {
4+
"commitMessage": "v${version}"
5+
},
6+
"github": {
7+
"release": true,
8+
"autoGenerate": true,
9+
"releaseName": "v${version}",
10+
"comments": {
11+
"submit": true
12+
}
13+
}
14+
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"expo-module": "expo-module",
1515
"open:ios": "open -a \"Xcode\" example/ios",
1616
"open:android": "open -a \"Android Studio\" example/android",
17-
"release": "np --no-tests"
17+
"release:local": "GITHUB_TOKEN=$(gh auth token) release-it"
1818
},
1919
"keywords": [
2020
"react-native",
@@ -38,7 +38,7 @@
3838
"@types/react": "^18.0.25",
3939
"expo-module-scripts": "^3.0.11",
4040
"expo-modules-core": "^1.5.11",
41-
"np": "^10.0.5"
41+
"release-it": "^18.1.2"
4242
},
4343
"packageManager": "yarn@1.22.21",
4444
"peerDependencies": {

0 commit comments

Comments
 (0)