Skip to content

Commit

Permalink
chore: update build.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Maidang1 committed Jun 26, 2024
1 parent 5ee8fdf commit cbb3780
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 59 deletions.
105 changes: 50 additions & 55 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,52 @@ jobs:
fail-fast: false
matrix:
settings:
# - os: ubuntu-latest
# docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
# abi: linux-x64-gnu
# build: >-
# git config --global --add safe.directory /build &&
# set -e &&
# unset CC_x86_64_unknown_linux_gnu &&
# unset CC &&
# pnpm --filter [HEAD^] build --target x86_64-unknown-linux-gnu --abi linux-x64-gnu
# - os: ubuntu-latest
# docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
# abi: linux-x64-musl
# build: >-
# git config --global --add safe.directory /build &&
# set -e &&
# unset CC_x86_64_unknown_linux_musl &&
# unset CC &&
# pnpm --filter [HEAD^] build --target x86_64-unknown-linux-musl --abi linux-x64-musl
# - os: windows-latest
# abi: win32-x64-msvc
# - os: macos-latest
# abi: darwin-arm64
# - os: macos-13
# abi: darwin-x64

# # cross compile
# # windows. Note swc plugins is not supported on ia32 and arm64
# - os: windows-latest
# abi: win32-ia32-msvc
# target: i686-pc-windows-msvc
# build: |
# export CARGO_PROFILE_RELEASE_LTO=false
# cargo install cargo-xwin &&
# pnpm --filter [HEAD^] build --target i686-pc-windows-msvc --abi win32-ia32-msvc --cargo-flags="--no-default-features"
# - os: windows-latest
# abi: win32-arm64-msvc
# target: aarch64-pc-windows-msvc
# build: |
# export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=256
# export CARGO_PROFILE_RELEASE_LTO=false
# cargo install cargo-xwin &&
# pnpm --filter [HEAD^] build --target aarch64-pc-windows-msvc --abi win32-arm64-msvc --cargo-flags="--no-default-features"
# # linux
# - os: ubuntu-latest
# abi: linux-arm64-musl
# target: aarch64-unknown-linux-musl
# zig: true
- os: ubuntu-latest
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
abi: linux-x64-gnu
build: >-
git config --global --add safe.directory /build &&
set -e &&
unset CC_x86_64_unknown_linux_gnu &&
unset CC &&
pnpm --filter [HEAD^] --sequential build --target x86_64-unknown-linux-gnu --abi linux-x64-gnu
- os: ubuntu-latest
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
abi: linux-x64-musl
build: >-
git config --global --add safe.directory /build &&
set -e &&
unset CC_x86_64_unknown_linux_musl &&
unset CC &&
pnpm --filter [HEAD^] --sequential build --target x86_64-unknown-linux-musl --abi linux-x64-musl
- os: windows-latest
abi: win32-x64-msvc
- os: macos-latest
abi: darwin-arm64
- os: macos-13
abi: darwin-x64
# cross compile
# windows. Note swc plugins is not supported on ia32 and arm64
- os: windows-latest
abi: win32-ia32-msvc
target: i686-pc-windows-msvc
build: |
export CARGO_PROFILE_RELEASE_LTO=false
cargo install cargo-xwin
pnpm --filter [HEAD^] --sequential build --target i686-pc-windows-msvc --abi win32-ia32-msvc --cargo-flags="--no-default-features"
- os: windows-latest
abi: win32-arm64-msvc
target: aarch64-pc-windows-msvc
build: |
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=256
export CARGO_PROFILE_RELEASE_LTO=false
cargo install cargo-xwin
pnpm --filter [HEAD^] --sequential build --target aarch64-pc-windows-msvc --abi win32-arm64-msvc --cargo-flags="--no-default-features"
# linux
- os: ubuntu-latest
abi: linux-arm64-musl
target: aarch64-unknown-linux-musl
zig: true
- os: ubuntu-latest
abi: linux-arm64-gnu
target: aarch64-unknown-linux-gnu
Expand All @@ -72,13 +71,9 @@ jobs:
with:
node-version: 18
- name: Install Dependencies
run: npm config set registry https://registry.npmmirror.com && npm install -g [email protected] && pnpm i --frozen-lockfile
- name: Install rust target
uses: dtolnay/rust-toolchain@stable
run: npm config set registry https://registry.npmmirror.com && npm install -g [email protected] && pnpm i --frozen-lockfile
- run: rustup target add ${{ matrix.settings.target }}
if: ${{ matrix.settings.target }}
with:
toolchain: stable
targets: ${{ matrix.settings.target }}
# Use the v1 of this action
- uses: mbround18/setup-osxcross@v1
if: ${{ matrix.settings.osxcross }}
Expand All @@ -97,7 +92,7 @@ jobs:
- name: Default Build
if: ${{ !matrix.settings.docker && !matrix.settings.build }}
run: >-
pnpm --filter [HEAD^] build --abi ${{ matrix.settings.abi }} ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }}
pnpm --filter [HEAD^] --sequential build --abi ${{ matrix.settings.abi }} ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }}
shell: bash
- name: Build
if: ${{ !matrix.settings.docker && matrix.settings.build }}
Expand All @@ -107,4 +102,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin
path: pnpm/${{ matrix.settings.abi }}/index.farm
path: packages/**/npm/${{ matrix.settings.abi }}/index.farm
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish packages and crates
on:
push:
branches:
- feat/monorepo
- feat/ci

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
done
- name: Install Dependencies
run: npm install -g pnpm@8.15.1 && pnpm i --frozen-lockfile
run: npm install -g pnpm@9.1.0 && pnpm i --frozen-lockfile

- name: Publish to npm
run: npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} && git_hash=$(git rev-parse --short "$GITHUB_SHA") && pnpm --filter [$git_hash] publish
# - name: Publish to npm
# run: npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} && git_hash=$(git rev-parse --short "$GITHUB_SHA") && pnpm --filter [$git_hash] publish
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "farm-plugins",
"version": "1.0.0",
"description": "The collections of farm plugins",
"packageManager": "[email protected]",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down

0 comments on commit cbb3780

Please sign in to comment.