Skip to content

Commit

Permalink
ci: update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed May 26, 2023
1 parent fcc6068 commit 4e3a0bf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,22 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: true
run_install: |
args: [--ignore-scripts]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Build
run: |
pnpm node-pre-gyp configure
pnpm node-pre-gyp build
pnpm node-pre-gyp package
- name: Build binary
run: pnpm binary:build

- name: Pack binary
run: pnpm binary:pack

- name: Release
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.NODE_PRE_GYP_GITHUB_TOKEN }}
run: pnpm node-pre-gyp-github publish --release
run: pnpm binary:release
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ on:

jobs:
test:
name: Test on ${{ matrix.os }} and Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [16, 18, 20]

steps:
Expand All @@ -22,14 +25,18 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: true
run_install: |
args: [--ignore-scripts]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Build binary
run: pnpm binary:build

- name: BenchMark
run: pnpm test:benchmark

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz"
},
"scripts": {
"binary:build": "node-pre-gyp build",
"binary:build": "node-gyp configure && node-pre-gyp build",
"binary:rebuild": "node-pre-gyp rebuild",
"binary:pack": "node-pre-gyp package",
"binary:release": "node-pre-gyp-github publish --release",
"build": "rollup -c rollup.config.ts --configPlugin esbuild",
"clean": "rimraf build/ dist/",
"test": "vitest",
Expand Down

0 comments on commit 4e3a0bf

Please sign in to comment.