Skip to content

Commit cf4d3b7

Browse files
committed
Add release workflow
1 parent 38353c0 commit cf4d3b7

File tree

4 files changed

+51
-3
lines changed

4 files changed

+51
-3
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 prerelease --workspaces --if-present",
24+
"release": "changeset publish"
2325
},
2426
"author": {
2527
"name": "Callstack",

packages/host/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"build-weak-node-api": "cmake-rn --no-auto-link --no-weak-node-api-linkage --xcframework-extension --source ./weak-node-api --out ./weak-node-api",
4848
"build-weak-node-api:all-triplets": "cmake-rn --android --apple --no-auto-link --no-weak-node-api-linkage --xcframework-extension --source ./weak-node-api --out ./weak-node-api",
4949
"test": "tsx --test --test-reporter=@reporters/github --test-reporter-destination=stdout --test-reporter=spec --test-reporter-destination=stdout src/node/**/*.test.ts src/node/*.test.ts",
50-
"bootstrap": "npm run copy-node-api-headers && npm run generate-weak-node-api-injector && npm run generate-weak-node-api && npm run build-weak-node-api"
50+
"bootstrap": "npm run copy-node-api-headers && npm run generate-weak-node-api-injector && npm run generate-weak-node-api && npm run build-weak-node-api",
51+
"prerelease": "npm run copy-node-api-headers && npm run generate-weak-node-api-injector && npm run generate-weak-node-api && npm run build-weak-node-api:all-triplets"
5152
},
5253
"keywords": [
5354
"react-native",

0 commit comments

Comments
 (0)