Skip to content

Commit 7b88237

Browse files
committed
feat: update workflows
1 parent 6663964 commit 7b88237

File tree

3 files changed

+143
-3
lines changed

3 files changed

+143
-3
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: napi
22
env:
33
DEBUG: napi:*
44
APP_NAME: oxvg
@@ -134,7 +134,7 @@ jobs:
134134
run: ls -R .
135135
shell: bash
136136
- name: Test bindings
137-
run: pnpm test
137+
run: pnpm --filter @oxvg/napi test
138138
publish:
139139
name: Publish
140140
runs-on: ubuntu-latest
@@ -156,7 +156,7 @@ jobs:
156156
with:
157157
path: artifacts
158158
- name: Move artifacts
159-
run: pnpm artifacts
159+
run: pnpm run -r artifacts
160160
- name: List packages
161161
run: ls -R ./npm
162162
shell: bash

.github/workflows/rust.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: rust
2+
env:
3+
CARGO_TERM_COLOR: always
4+
on:
5+
push:
6+
branches: main
7+
pull_request:
8+
branches: null
9+
jobs:
10+
build:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
settings:
15+
- host: macos-latest
16+
target: x86_64-apple-darwin
17+
- host: windows-latest
18+
target: x86_64-pc-windows-msvc
19+
- host: ubuntu-latest
20+
target: x86_64-unknown-linux-gnu
21+
- host: macos-latest
22+
target: aarch64-apple-darwin
23+
name: build - ${{ matrix.settings.target }}
24+
runs-on: ${{ matrix.settings.host }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Install
28+
uses: dtolnay/rust-toolchain@stable
29+
with:
30+
toolchain: stable
31+
targets: ${{ matrix.settings.target }}
32+
- name: Cache cargo
33+
uses: actions/cache@v4
34+
with:
35+
path: |
36+
~/.cargo/registry/index/
37+
~/.cargo/registry/cache/
38+
~/.cargo/git/db/
39+
.cargo-cache
40+
target/
41+
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
42+
- name: Build
43+
run: cargo build --verbose
44+
- name: Run tests
45+
run: cargo test --verbose
46+
- name: Upload artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: binary-${{ matrix.settings.target }}
50+
path: target/release/oxvg
51+
if-no-files-found: error

.github/workflows/wasm.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: wasm
2+
env:
3+
DEBUG: napi:*
4+
APP_NAME: oxvg
5+
MACOSX_DEPLOYMENT_TARGET: '10.13'
6+
permissions:
7+
contents: write
8+
id-token: write
9+
'on':
10+
push:
11+
branches:
12+
- main
13+
tags-ignore:
14+
- '**'
15+
paths-ignore:
16+
- '**/*.md'
17+
- LICENSE
18+
- '**/*.gitignore'
19+
- .editorconfig
20+
- docs/**
21+
pull_request: null
22+
jobs:
23+
build:
24+
name: wasm - node@22
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: setup pnpm
29+
uses: pnpm/action-setup@v4
30+
- name: Setup node
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: 22
34+
cache: pnpm
35+
- name: Install
36+
uses: dtolnay/rust-toolchain@stable
37+
with:
38+
toolchain: stable
39+
targets: wasm32-unknown-unknown
40+
- name: Cache cargo
41+
uses: actions/cache@v4
42+
with:
43+
path: |
44+
~/.cargo/registry/index/
45+
~/.cargo/registry/cache/
46+
~/.cargo/git/db/
47+
.cargo-cache
48+
target/
49+
key: wasm32-unknown-unknown
50+
- name: Install dependencies
51+
run: pnpm install
52+
- name: Setup node x86
53+
uses: actions/setup-node@v4
54+
- name: Build
55+
run: pnpm --filter @oxvg/wasm build
56+
shell: bash
57+
- name: Test
58+
run: pnpm --filter @oxvg/wasm test
59+
publish:
60+
name: Publish
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v4
64+
- name: setup pnpm
65+
uses: pnpm/action-setup@v4
66+
- name: Setup node
67+
uses: actions/setup-node@v4
68+
with:
69+
node-version: 22
70+
cache: pnpm
71+
- name: Install dependencies
72+
run: pnpm install
73+
- name: Publish
74+
run: |
75+
npm config set provenance true
76+
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
77+
then
78+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
79+
npm publish --access public
80+
elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
81+
then
82+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
83+
npm publish --tag next --access public
84+
else
85+
echo "Not a release, skipping publish"
86+
fi
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)