Skip to content

Commit 5e96f7b

Browse files
authored
chore: upgrade NAPI-RS to 3.0 stable (#26)
1 parent de0794e commit 5e96f7b

File tree

4 files changed

+166
-135
lines changed

4 files changed

+166
-135
lines changed

.github/workflows/release-plz.yml

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,63 @@
1-
name: Release Plz
1+
name: Release-plz
22

3-
permissions: {}
3+
permissions:
4+
pull-requests: write
5+
contents: write
46

57
on:
6-
workflow_dispatch:
78
push:
89
branches:
910
- main
1011

11-
concurrency:
12-
group: ${{ github.workflow }}-${{ github.ref }}
13-
cancel-in-progress: true
14-
1512
jobs:
16-
release-plz:
13+
# Release unpublished packages.
14+
release-plz-release:
15+
name: Release-plz release
1716
runs-on: ubuntu-latest
17+
if: ${{ github.repository_owner == 'napi-rs' }}
1818
permissions:
1919
contents: write
20-
pull-requests: write
20+
id-token: write
2121
steps:
22-
- uses: actions/checkout@v4
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
2324
with:
2425
fetch-depth: 0
2526
submodules: recursive
27+
- name: Install Rust toolchain
28+
uses: dtolnay/rust-toolchain@stable
29+
- uses: rust-lang/crates-io-auth-action@v1
30+
id: auth
31+
- name: Run release-plz
32+
uses: release-plz/[email protected]
33+
with:
34+
command: release
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
2638

39+
# Create a PR with the new versions and changelog, preparing the next release.
40+
release-plz-pr:
41+
name: Release-plz PR
42+
runs-on: ubuntu-latest
43+
if: ${{ github.repository_owner == 'napi-rs' }}
44+
permissions:
45+
contents: write
46+
pull-requests: write
47+
concurrency:
48+
group: release-plz-${{ github.ref }}
49+
cancel-in-progress: false
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v4
53+
with:
54+
fetch-depth: 0
55+
submodules: recursive
56+
- name: Install Rust toolchain
57+
uses: dtolnay/rust-toolchain@stable
2758
- name: Run release-plz
28-
id: release-plz
2959
uses: release-plz/[email protected]
60+
with:
61+
command: release-pr
3062
env:
3163
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }}

example/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ publish = false
88
crate-type = ["cdylib", "lib"]
99

1010
[dependencies]
11-
napi = "3.0.0-beta"
12-
napi-derive = "3.0.0-beta"
11+
napi = "3"
12+
napi-derive = "3"
1313

1414
[target.'cfg(target_os = "linux")'.dependencies]
1515
mimalloc-safe = { path = "../", features = ["local_dynamic_tls", "skip_collect_on_exit"] }

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"build": "napi build"
66
},
77
"devDependencies": {
8-
"@napi-rs/cli": "canary"
8+
"@napi-rs/cli": "^3.0.1"
99
},
1010
"packageManager": "[email protected]"
1111
}

0 commit comments

Comments
 (0)