Skip to content

Commit 8cdd768

Browse files
Merge pull request #28 from QuartzLibrary/bump
Release `0.7.0` and NPM package
2 parents 950ff1f + 6f4f089 commit 8cdd768

15 files changed

Lines changed: 473 additions & 279 deletions

File tree

.github/workflows/publish-node.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Publish Node
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
strategy:
9+
matrix:
10+
include:
11+
- os: ubuntu-latest
12+
target: x86_64-unknown-linux-gnu
13+
binary: schema_analysis-linux-x64
14+
- os: ubuntu-latest
15+
target: aarch64-unknown-linux-gnu
16+
binary: schema_analysis-linux-arm64
17+
- os: macos-latest
18+
target: x86_64-apple-darwin
19+
binary: schema_analysis-darwin-x64
20+
- os: macos-latest
21+
target: aarch64-apple-darwin
22+
binary: schema_analysis-darwin-arm64
23+
- os: windows-latest
24+
target: x86_64-pc-windows-msvc
25+
binary: schema_analysis-win32-x64.exe
26+
runs-on: ${{ matrix.os }}
27+
steps:
28+
- uses: actions/checkout@v6
29+
30+
- uses: dtolnay/rust-toolchain@stable
31+
with:
32+
targets: ${{ matrix.target }}
33+
34+
- name: Install cross-compilation tools
35+
if: matrix.target == 'aarch64-unknown-linux-gnu'
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install -y gcc-aarch64-linux-gnu
39+
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
40+
41+
- name: Build
42+
run: cargo build --release --features cli --target ${{ matrix.target }}
43+
working-directory: schema_analysis
44+
45+
- name: Rename binary (unix)
46+
if: runner.os != 'Windows'
47+
run: cp target/${{ matrix.target }}/release/schema_analysis packages/node/binaries/${{ matrix.binary }}
48+
49+
- name: Rename binary (windows)
50+
if: runner.os == 'Windows'
51+
run: cp target/${{ matrix.target }}/release/schema_analysis.exe packages/node/binaries/${{ matrix.binary }}
52+
53+
- uses: actions/upload-artifact@v4
54+
with:
55+
name: ${{ matrix.binary }}
56+
path: packages/node/binaries/${{ matrix.binary }}
57+
58+
publish:
59+
needs: build
60+
runs-on: ubuntu-latest
61+
environment: npm
62+
permissions:
63+
id-token: write
64+
steps:
65+
- uses: actions/checkout@v6
66+
67+
- uses: actions/setup-node@v4
68+
with:
69+
node-version: 22
70+
registry-url: https://registry.npmjs.org
71+
72+
- uses: actions/download-artifact@v4
73+
with:
74+
path: packages/node/binaries
75+
merge-multiple: true
76+
77+
- run: chmod +x packages/node/binaries/*
78+
79+
- run: npx npm@latest publish --provenance
80+
working-directory: packages/node

0 commit comments

Comments
 (0)