File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 matrix :
1616 rust_version :
1717 - stable
18- # Uncomment after Rust 1.90.0 comes out: https://github.com/rust-lang/rust/issues/145699
19- # - beta
18+ - beta
19+ # These should match those in the `docker-test` job
2020 node_version :
2121 - 20
2222 - 22
@@ -55,33 +55,15 @@ jobs:
5555 - name : Run tests
5656 run : yarn run test
5757
58- test-docker :
59- runs-on : ${{ matrix.os }}
60- container :
61- image : node:${{ matrix.node_version }}-alpine
58+ # Used to create musl binaries
59+ docker-test :
60+ runs-on : ${{ matrix.system.os }}
6261 strategy :
6362 matrix :
64- rust_version :
65- - stable
66- - beta
67- node_version :
68- - 20
69- - 22
70- - 24
71- os :
72- - ubuntu-24.04
73- - ubuntu-24.04-arm
63+ system :
64+ - os : [ubuntu-24.04, ubuntu-24.04-arm]
7465 fail-fast : false
7566 steps :
76- - run : apk add build-base git python3 wget
77- - run : echo RUSTFLAGS="-C target-feature=-crt-static" >> "${GITHUB_ENV}"
7867 - uses : actions/checkout@v5
79- - uses : IronCoreLabs/rust-toolchain@v1
80- with :
81- toolchain : ${{ matrix.rust_version }}
82- - name : Install modules
83- run : yarn install --ignore-scripts
84- - name : Compile
85- run : yarn run compile
86- - name : Run tests
87- run : yarn run test
68+ # These Node versions should match those above in the `test` job.
69+ - run : for NODE_VERSION in 20 22 24; do docker build --build-arg NODE_VERSION=$NODE_VERSION .; done
Original file line number Diff line number Diff line change 88artifacts.json
99dist /*
1010bin-package /*
11+ host-artifacts /*
1112build /*
1213.idea /*
1314.direnv
Original file line number Diff line number Diff line change 1+ # This Dockerfile produces a musl binary for recrypt-node-binding.
2+ # It can be built with this command to copy the result out into ./host-artifacts/out
3+ # docker build --build-arg NODE_VERSION=24 --output type=local,dest=./host-artifacts .
4+
5+ ARG NODE_VERSION=24
6+ FROM node:${NODE_VERSION}-alpine3.22 AS build
7+
8+ RUN apk add --no-cache \
9+ build-base \
10+ rust \
11+ cargo
12+ COPY . /app
13+ WORKDIR /app
14+ RUN yarn install
15+ RUN node publish.js
16+
17+ FROM scratch AS artifacts
18+ WORKDIR /out
19+ COPY --from=build /app/bin-package ./
Original file line number Diff line number Diff line change 3030 "test" : " jest --maxWorkers=50%"
3131 },
3232 "dependencies" : {
33- "@mapbox/node-pre-gyp" : " ^1 .0.7 "
33+ "@mapbox/node-pre-gyp" : " ^2 .0.0 "
3434 },
3535 "devDependencies" : {
3636 "@types/node" : " ^16.11.11" ,
Original file line number Diff line number Diff line change 1111 * + Compile rust code into index.node file.
1212 * + Run unit tests to ensure the library is in good shape for publishing.
1313 * + Move all expected content into a `dist` directory.
14- * + Generate a binary distrubtion in `bin-package`.
14+ * + Generate a binary distribution in `bin-package`.
1515 * + Do a dry run of npm publishing via irish-pub or perform an actual publish step if `--publish` option is provided.
1616 */
1717
@@ -63,7 +63,7 @@ var tgz = shell.exec("find ./build -name *.tar.gz");
6363shell . cp ( tgz , "./bin-package/" ) ;
6464shell . pushd ( "./dist" ) ;
6565
66- var publishCmd = "echo 'Skipping publishing to npm...'"
66+ var publishCmd = "echo 'Skipping publishing to npm...'" ;
6767if ( shouldPublish ) {
6868 publishCmd = "npm publish --access public" ;
6969 // If we're publishing a branch build or prerelease like "1.2.3-pre.4", use "--tag next".
You can’t perform that action at this time.
0 commit comments