From 4e3a0bfbf6a5cda36cb2f0da5844782b21356d10 Mon Sep 17 00:00:00 2001 From: "Mr.Hope" Date: Fri, 26 May 2023 16:14:11 +0800 Subject: [PATCH] ci: update ci --- .github/workflows/release.yml | 15 ++++++++------- .github/workflows/test.yml | 9 ++++++++- package.json | 4 +++- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b01cba..9f10f5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,8 @@ 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 @@ -30,13 +31,13 @@ jobs: 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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cab49a1..f3a3577 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: @@ -22,7 +25,8 @@ 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 @@ -30,6 +34,9 @@ jobs: node-version: ${{ matrix.node-version }} cache: "pnpm" + - name: Build binary + run: pnpm binary:build + - name: BenchMark run: pnpm test:benchmark diff --git a/package.json b/package.json index c6277b2..3a74a87 100644 --- a/package.json +++ b/package.json @@ -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",