Skip to content

Commit 4768e85

Browse files
Merge pull request #2618 from o1-labs/leon/release-native-package
feat: release native package
2 parents a4a8c0c + 555dcde commit 4768e85

File tree

20 files changed

+2110
-202
lines changed

20 files changed

+2110
-202
lines changed

.config/cspell.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"doccomments",
5959
"docstrings",
6060
"dont",
61+
"dtolnay",
6162
"dxdy",
6263
"dynlink",
6364
"eddsa",
@@ -187,6 +188,7 @@
187188
"revspec",
188189
"RIGHTSHIFT",
189190
"rimraf",
191+
"Rminus",
190192
"rnew",
191193
"rngs",
192194
"rotr",
@@ -195,7 +197,6 @@
195197
"RUSTDIR",
196198
"rustlib",
197199
"rustup",
198-
"Rminus",
199200
"SBOX",
200201
"Schnorr",
201202
"Schönhage",
@@ -233,18 +234,18 @@
233234
"tweakable",
234235
"twoadic",
235236
"twoadicity",
237+
"uints",
236238
"underconstraint",
237239
"underflowed",
238240
"underflows",
239241
"unew",
240-
"uints",
241-
"untar",
242242
"unhash",
243243
"unhashing",
244244
"unintuitively",
245245
"unpackaging",
246246
"unreconstructable",
247247
"Unshifted",
248+
"untar",
248249
"Vanstone",
249250
"Varbase",
250251
"varfields",
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Native
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
publish-native-packages:
7+
name: Publish
8+
strategy:
9+
matrix:
10+
os: [
11+
macos-latest,
12+
macos-15-intel,
13+
ubuntu-latest,
14+
ubuntu-22.04-arm,
15+
# windows-latest,
16+
]
17+
runs-on: ${{ matrix.os }}
18+
permissions:
19+
contents: read
20+
id-token: write # required for npm publish --provenance
21+
steps:
22+
- uses: actions/checkout@v5
23+
with:
24+
submodules: recursive
25+
- uses: actions/setup-node@v6
26+
with:
27+
node-version: 24
28+
registry-url: "https://registry.npmjs.org"
29+
- run: npm ci
30+
31+
- uses: ocaml/setup-ocaml@v3
32+
with:
33+
ocaml-compiler: 4.14.2
34+
- uses: actions/cache@v4
35+
id: cache-opam
36+
with:
37+
path: ./_opam/
38+
key: ${{ runner.OS }}-${{ runner.arch }}-opam-${{ hashFiles('./scripts/prepublish/native/prepublish-native-package.opam') }}
39+
- name: opam install
40+
if: ${{ steps.cache-opam.outputs.cache-hit != 'true' }}
41+
run: |
42+
opam install \
43+
--deps-only \
44+
-y \
45+
./scripts/prepublish/native/prepublish-native-package.opam
46+
47+
- uses: dtolnay/rust-toolchain@master
48+
with:
49+
toolchain: nightly-2024-09-05
50+
targets: wasm32-unknown-unknown
51+
components: rust-src
52+
53+
- name: Build native package
54+
run: |
55+
set -Eeuxo pipefail
56+
eval $(opam env)
57+
npm run build:native
58+
59+
- name: Prepare native package
60+
run: |
61+
set -Eeuxo pipefail
62+
npm run native:prepublish
63+
64+
- name: Publish native package
65+
env:
66+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
67+
run: |
68+
set -Eeuxo pipefail
69+
70+
npm run native:publish

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ result
1616
# precompiled bindings
1717
src/bindings/compiled
1818
.bindings_download
19-
native/
19+
/native
2020

2121
# rust-analyzer
2222
target/

0 commit comments

Comments
 (0)