瀏覽代碼

ci: update ci template (#343)

LongYinan 1 年之前
父節點
當前提交
10c3d9d3dd
共有 7 個文件被更改,包括 2519 次插入2590 次删除
  1. 18 21
      .github/workflows/CI.yml
  2. 0 874
      .yarn/releases/yarn-3.6.4.cjs
  3. 893 0
      .yarn/releases/yarn-4.0.1.cjs
  4. 1 1
      .yarnrc.yml
  5. 15 0
      index.js
  6. 9 9
      package.json
  7. 1583 1685
      yarn.lock

+ 18 - 21
.github/workflows/CI.yml

@@ -140,7 +140,6 @@ jobs:
         if: matrix.settings.target == 'i686-pc-windows-msvc'
         with:
           node-version: 18
-          check-latest: true
           cache: yarn
           architecture: x86
       - name: Build in docker
@@ -167,30 +166,29 @@ jobs:
       - uses: actions/checkout@v4
       - name: Build
         id: build
-        uses: vmactions/freebsd-vm@v0
+        uses: cross-platform-actions/action@v0.21.0
         env:
           DEBUG: napi:*
-          RUSTUP_HOME: /usr/local/rustup
-          CARGO_HOME: /usr/local/cargo
           RUSTUP_IO_THREADS: 1
         with:
-          envs: DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS
-          usesh: true
-          mem: 3000
-          prepare: |
-            pkg install -y -f curl node libnghttp2 npm
-            npm install -g yarn --ignore-scripts
+          operating_system: freebsd
+          version: '13.2'
+          memory: 13G
+          cpu_count: 3
+          environment_variables: 'DEBUG RUSTUP_IO_THREADS'
+          shell: bash
+          run: |
+            sudo pkg install -y -f curl node libnghttp2 npm
+            sudo npm install -g yarn --ignore-scripts
             curl https://sh.rustup.rs -sSf --output rustup.sh
             sh rustup.sh -y --profile minimal --default-toolchain beta
-            export PATH="/usr/local/cargo/bin:$PATH"
+            source "$HOME/.cargo/env"
             echo "~~~~ rustc --version ~~~~"
             rustc --version
             echo "~~~~ node -v ~~~~"
             node -v
             echo "~~~~ yarn --version ~~~~"
             yarn --version
-          run: |
-            export PATH="/usr/local/cargo/bin:$PATH"
             pwd
             ls -lah
             whoami
@@ -198,8 +196,6 @@ jobs:
             freebsd-version
             yarn install
             yarn build
-            strip -x *.node
-            yarn test
             rm -rf node_modules
             rm -rf target
             rm -rf .yarn/cache
@@ -222,8 +218,8 @@ jobs:
           - host: macos-latest
             target: x86_64-apple-darwin
         node:
-          - '16'
           - '18'
+          - '20'
     runs-on: ${{ matrix.settings.host }}
     steps:
       - uses: actions/checkout@v4
@@ -252,8 +248,8 @@ jobs:
       fail-fast: false
       matrix:
         node:
-          - '16'
           - '18'
+          - '20'
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
@@ -282,8 +278,8 @@ jobs:
       fail-fast: false
       matrix:
         node:
-          - '16'
           - '18'
+          - '20'
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
@@ -314,8 +310,8 @@ jobs:
       fail-fast: false
       matrix:
         node:
-          - '16'
           - '18'
+          - '20'
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
@@ -347,7 +343,7 @@ jobs:
             yarn test
             ls -la
   test-linux-aarch64-musl-binding:
-    name: Test bindings on aarch64-unknown-linux-musl - node@${{ matrix.node }}
+    name: Test bindings on aarch64-unknown-linux-musl - node@lts
     needs:
       - build
     runs-on: ubuntu-latest
@@ -387,8 +383,8 @@ jobs:
       fail-fast: false
       matrix:
         node:
-          - '16'
           - '18'
+          - '20'
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
@@ -449,6 +445,7 @@ jobs:
         shell: bash
       - name: Publish
         run: |
+          npm config set provenance true
           if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
           then
             echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc

文件差異過大導致無法顯示
+ 0 - 874
.yarn/releases/yarn-3.6.4.cjs


文件差異過大導致無法顯示
+ 893 - 0
.yarn/releases/yarn-4.0.1.cjs


+ 1 - 1
.yarnrc.yml

@@ -2,4 +2,4 @@ nodeLinker: node-modules
 
 npmAuditRegistry: "https://registry.npmjs.org"
 
-yarnPath: .yarn/releases/yarn-3.6.4.cjs
+yarnPath: .yarn/releases/yarn-4.0.1.cjs

+ 15 - 0
index.js

@@ -1,3 +1,9 @@
+/* tslint:disable */
+/* eslint-disable */
+/* prettier-ignore */
+
+/* auto-generated by NAPI-RS */
+
 const { existsSync, readFileSync } = require('fs')
 const { join } = require('path')
 
@@ -96,6 +102,15 @@ switch (platform) {
     }
     break
   case 'darwin':
+    localFileExisted = existsSync(join(__dirname, 'package-template.darwin-universal.node'))
+    try {
+      if (localFileExisted) {
+        nativeBinding = require('./package-template.darwin-universal.node')
+      } else {
+        nativeBinding = require('@napi-rs/package-template-darwin-universal')
+      }
+      break
+    } catch {}
     switch (arch) {
       case 'x64':
         localFileExisted = existsSync(join(__dirname, 'package-template.darwin-x64.node'))

+ 9 - 9
package.json

@@ -57,21 +57,21 @@
     "version": "napi version"
   },
   "devDependencies": {
-    "@napi-rs/cli": "^2.16.3",
+    "@napi-rs/cli": "^2.16.4",
     "@swc-node/register": "^1.6.8",
-    "@swc/core": "^1.3.92",
+    "@swc/core": "^1.3.95",
     "@taplo/cli": "^0.5.2",
-    "@typescript-eslint/eslint-plugin": "^6.7.4",
-    "@typescript-eslint/parser": "^6.7.4",
+    "@typescript-eslint/eslint-plugin": "^6.9.1",
+    "@typescript-eslint/parser": "^6.9.1",
     "ava": "^5.3.1",
     "benny": "^3.7.1",
     "chalk": "^5.3.0",
-    "eslint": "^8.51.0",
+    "eslint": "^8.52.0",
     "eslint-config-prettier": "^9.0.0",
-    "eslint-plugin-import": "^2.28.1",
-    "eslint-plugin-prettier": "^5.0.0",
+    "eslint-plugin-import": "^2.29.0",
+    "eslint-plugin-prettier": "^5.0.1",
     "husky": "^8.0.3",
-    "lint-staged": "^15.0.0",
+    "lint-staged": "^15.0.2",
     "npm-run-all": "^4.1.5",
     "prettier": "^3.0.3",
     "typescript": "^5.2.2"
@@ -107,5 +107,5 @@
     "singleQuote": true,
     "arrowParens": "always"
   },
-  "packageManager": "yarn@3.6.4"
+  "packageManager": "yarn@4.0.1"
 }

文件差異過大導致無法顯示
+ 1583 - 1685
yarn.lock