Skip to content

Commit

Permalink
ci: update ci template (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn authored Nov 1, 2023
1 parent bdb93bc commit 10c3d9d
Show file tree
Hide file tree
Showing 7 changed files with 2,519 additions and 2,590 deletions.
39 changes: 18 additions & 21 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -167,39 +166,36 @@ 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
env
freebsd-version
yarn install
yarn build
strip -x *.node
yarn test
rm -rf node_modules
rm -rf target
rm -rf .yarn/cache
Expand All @@ -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
Expand Down Expand Up @@ -252,8 +248,8 @@ jobs:
fail-fast: false
matrix:
node:
- '16'
- '18'
- '20'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -282,8 +278,8 @@ jobs:
fail-fast: false
matrix:
node:
- '16'
- '18'
- '20'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -314,8 +310,8 @@ jobs:
fail-fast: false
matrix:
node:
- '16'
- '18'
- '20'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -387,8 +383,8 @@ jobs:
fail-fast: false
matrix:
node:
- '16'
- '18'
- '20'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -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
Expand Down
874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.4.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 15 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/* tslint:disable */
/* eslint-disable */
/* prettier-ignore */

/* auto-generated by NAPI-RS */

const { existsSync, readFileSync } = require('fs')
const { join } = require('path')

Expand Down Expand Up @@ -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'))
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -107,5 +107,5 @@
"singleQuote": true,
"arrowParens": "always"
},
"packageManager": "yarn@3.6.4"
"packageManager": "yarn@4.0.1"
}
Loading

0 comments on commit 10c3d9d

Please sign in to comment.