Skip to content

Commit 664b04c

Browse files
committed
Add release workflow
1 parent 38353c0 commit 664b04c

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

.changeset/config.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
"changelog": "@changesets/cli/changelog",
44
"commit": false,
55
"fixed": [],
6-
"linked": [],
6+
"linked": [
7+
["cmake-rn", "react-native-node-api"],
8+
["ferric-cli", "react-native-node-api"]
9+
],
710
"access": "restricted",
811
"baseBranch": "main",
912
"updateInternalDependencies": "patch",

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
env:
4+
# Version here should match the one in React Native template and packages/cmake-rn/src/cli.ts
5+
NDK_VERSION: 27.1.12297006
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
concurrency: ${{ github.workflow }}-${{ github.ref }}
13+
14+
jobs:
15+
release:
16+
name: Release
17+
runs-on: macos-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: lts/jod
23+
- name: Set up JDK 17
24+
uses: actions/setup-java@v3
25+
with:
26+
java-version: "17"
27+
distribution: "temurin"
28+
- name: Setup Android SDK
29+
uses: android-actions/setup-android@v3
30+
with:
31+
packages: tools platform-tools ndk;${{ env.NDK_VERSION }}
32+
- run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android aarch64-apple-ios-sim
33+
- run: npm ci
34+
35+
- name: Create Release Pull Request or Publish to npm
36+
id: changesets
37+
uses: changesets/action@v1
38+
with:
39+
publish: npm run release
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
"dev": "tsc --build --watch",
2020
"lint": "eslint .",
2121
"test": "npm run test --workspace react-native-node-api --workspace cmake-rn --workspace gyp-to-cmake --workspace node-addon-examples",
22-
"bootstrap": "npm run build && npm run bootstrap --workspaces --if-present"
22+
"bootstrap": "npm run build && npm run bootstrap --workspaces --if-present",
23+
"prerelease": "npm run build && npm run build-weak-node-api:all-triplets --workspace react-native-node-api",
24+
"release": "changeset publish"
2325
},
2426
"author": {
2527
"name": "Callstack",

0 commit comments

Comments
 (0)