Skip to content

Commit

Permalink
feat: Add support for aarch64-apple-darwin and `x86_64-unknown-linu…
Browse files Browse the repository at this point in the history
…x-musl` (#12)

ci: support  `aarch64-apple-darwin` and `x86_64-unknown-linux-musl`
  • Loading branch information
ErKeLost authored Jan 16, 2024
1 parent 7139e6d commit 272bd52
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 105 deletions.
48 changes: 30 additions & 18 deletions .github/workflows/napi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,42 @@ jobs:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
build: |
yarn build
strip -x *.node
- host: windows-latest
build: yarn build
target: x86_64-pc-windows-msvc

- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |-
build: |
set -e &&
corepack enable &&
yarn build --target x86_64-unknown-linux-gnu &&
strip *.node
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: set -e && yarn build && strip *.node

- host: macos-latest
target: x86_64-apple-darwin
build: |
yarn build
strip -x *.node
- host: macos-latest
target: aarch64-apple-darwin
build: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
export CC=$(xcrun -f clang);
export CXX=$(xcrun -f clang++);
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
rustup target add aarch64-apple-darwin
yarn build --target aarch64-apple-darwin
strip -x *.node
defaults:
run:
working-directory: ${{ env.WORKING_DIR_PATH }}
Expand All @@ -61,7 +81,6 @@ jobs:
with:
node-version: 18
# cache: yarn
# cache-dependency-path: ${{ env.WORKING_DIR_PATH }}/yarn.lock
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
if: ${{ !matrix.settings.docker }}
Expand Down Expand Up @@ -99,7 +118,6 @@ jobs:
node-version: 18
# cache: yarn
architecture: x86
# cache-dependency-path: ${{ env.WORKING_DIR_PATH }}/yarn.lock
- name: Build in docker
uses: addnab/docker-run-action@v3
if: ${{ matrix.settings.docker }}
Expand All @@ -115,7 +133,7 @@ jobs:
run: ls -a
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: ${{ env.WORKING_DIR_PATH }}/${{ env.APP_NAME }}.*.node
Expand Down Expand Up @@ -147,11 +165,10 @@ jobs:
with:
node-version: ${{ matrix.node }}
# cache: yarn
# cache-dependency-path: ${{ env.WORKING_DIR_PATH }}/yarn.lock
- name: Install dependencies
run: corepack enable; yarn install
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: ${{ env.WORKING_DIR_PATH }}
Expand Down Expand Up @@ -182,11 +199,10 @@ jobs:
with:
node-version: ${{ matrix.node }}
# cache: yarn
# cache-dependency-path: ${{ env.WORKING_DIR_PATH }}/yarn.lock
- name: Install dependencies
run: corepack enable; yarn install
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: bindings-x86_64-unknown-linux-gnu
path: ${{ env.WORKING_DIR_PATH }}
Expand All @@ -202,21 +218,17 @@ jobs:
needs:
- test-macOS-windows-binding
- test-linux-x64-gnu-binding
defaults:
run:
working-directory: ${{ env.WORKING_DIR_PATH }}
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
# cache: yarn
# cache-dependency-path: ${{ env.WORKING_DIR_PATH }}/yarn.lock
- name: Install dependencies
run: corepack enable; yarn install
- name: Download all artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: ${{ env.WORKING_DIR_PATH }}/artifacts
- name: Move artifacts
Expand Down
183 changes: 96 additions & 87 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,109 +6,118 @@
"language": "en",
// words - list of words to be always considered correct
"words": [
"aarch",
"androideabi",
"armv",
"attrless",
"basefont",
"bazqux",
"bgsound",
"bindgen",
"blockquote",
"builtins",
"BUILTINS",
"bytepos",
"camelcase",
"codegen",
"colgroup",
"commitlint",
"napi",
"NAPI",
"keygen",
"RCDATA",
"peekable",
"splitn",
"itervar",
"slotname",
"todos",
"inited",
"necolas",
"BUILTINS",
"builtins",
"smallvec",
"unref",
"idents",
"VDOM",
"Unkeyed",
"fxhash",
"quasis",
"componentlike",
"cssparser",
"ctxt",
"curr",
"datalist",
"dedupe",
"elems",
"propname",
"postprocess",
"loremipsum",
"parseable",
"destr",
"destructures",
"ctxt",
"curr",
"srcdoc",
"doesnot",
"eabi",
"elems",
"fieldset",
"figcaption",
"flagset",
"frameset",
"fullwidth",
"fxhash",
"gnueabihf",
"gopd",
"hgroup",
"idents",
"iframe",
"mimalloc",
"aarch",
"stackback",
"siginfo",
"inited",
"isexe",
"gopd",
"sugarss",
"lightningcss",
"vite",
"tinypool",
"tinybench",
"picocolors",
"webdriverio",
"safaridriver",
"isindex",
"itervar",
"jsdom",
"armv",
"msvc",
"gnueabihf",
"aarch",
"androideabi",
"taplo",
"Parens",
"aarch",
"keepalive",
"keygen",
"libc",
"gnueabihf",
"eabi",
"smth",
"lightningcss",
"stylesheet",
"cssparser",
"flagset",
"itervar",
"vnode",
"Unkeyed",
"tspan",
"thead",
"tbody",
"polyline",
"optgroup",
"noscript",
"noframes",
"noembed",
"nobr",
"loremipsum",
"mimalloc",
"msvc",
"multicol",
"napi",
"NAPI",
"necolas",
"nextid",
"hgroup",
"doesnot",
"camelcase",
"vmodel",
"attrless",
"nobr",
"noembed",
"noframes",
"noscript",
"optgroup",
"Parens",
"parseable",
"pascalcase",
"basefont",
"bgsound",
"blockquote",
"colgroup",
"datalist",
"fieldset",
"figcaption",
"frameset",
"isindex",
"multicol",
"peekable",
"picocolors",
"polyline",
"postprocess",
"propname",
"quasis",
"RCDATA",
"safaridriver",
"samp",
"siginfo",
"slotname",
"smallvec",
"smth",
"splitn",
"srcdoc",
"stackback",
"stylesheet",
"sugarss",
"taplo",
"tbody",
"tfoot",
"thead",
"tinybench",
"tinypool",
"todos",
"tspan",
"Unkeyed",
"unref",
"VDOM",
"vite",
"Vitest",
"componentlike",
"keepalive",
"bazqux",
"pascalcase"
"vmodel",
"vnode",
"unplugin",
"Unplugin",
"rspack",
"tmpl",
"reassignable",
"rfind",
"customcomponent",
"kleur",
"riscv",
"filehash",
"webdriverio"
],
"ignorePaths": [".github/**", "**/*.toml", "pnpm-lock.yaml", "README.md"]
"ignorePaths": [
".github/**",
"**/*.toml",
"pnpm-lock.yaml",
"README.md"
]
}

0 comments on commit 272bd52

Please sign in to comment.