Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: build all platform by ci #1508

Closed
wants to merge 6 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions .github/workflows/node-bind-build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: node-bind-build
env:
DEBUG: napi:*
APP_NAME: okam
APP_NAME: mako
MACOSX_DEPLOYMENT_TARGET: '10.13'
'on':
push:
Expand All @@ -20,14 +20,14 @@ env:
jobs:
pre-check:
name: Check Is Release node-binding
if: "contains(github.event.head_commit.message, 'Release')"
if: startsWith(github.event.head_commit.message, 'release')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: is Release Commit
run: |
echo Start Release
if git log -1 --pretty=%B | grep "^Release [0-9]\+\.[0-9]\+\.[0-9]\+"; then
if git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+"; then
echo "start Release"
else
gh run cancel ${{ github.run_id }}
Expand All @@ -45,21 +45,35 @@ jobs:
- host: macos-latest
target: x86_64-apple-darwin
build: |
pnpm --filter @okamjs/okam build --target x86_64-apple-darwin
rustup target add x86_64-apple-darwin
pnpm --filter @umijs/mako build --target x86_64-apple-darwin
strip -x ./packages/mako/*.node
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |-
set -e &&
pnpm --filter @okamjs/okam build --target x86_64-unknown-linux-gnu &&
rustup target add x86_64-unknown-linux-gnu &&
pnpm --filter @umijs/mako build --target x86_64-unknown-linux-gnu &&
strip ./packages/mako/*.node
- host: macos-latest
target: aarch64-apple-darwin
build: |
rustup target add aarch64-apple-darwin
pnpm --filter @okamjs/okam build --target aarch64-apple-darwin
pnpm --filter @umijs/mako build --target aarch64-apple-darwin
strip -x ./packages/mako/*.node
- host: windows-latest
build: |
rustup target add x86_64-pc-windows-msvc
pnpm --filter @umijs/mako build --target x86_64-pc-windows-msvc
strip -x ./packages/mako/*.node
target: x86_64-pc-windows-msvc
- host: windows-latest
build: |
rustup target add i686-pc-windows-msvc
pnpm --filter @umijs/mako build --target i686-pc-windows-msvc
strip -x ./packages/mako/*.node
target: i686-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@18
runs-on: ${{ matrix.settings.host }}
steps:
Expand Down Expand Up @@ -100,10 +114,6 @@ jobs:
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
shell: bash
- name: Setup node x86
if: matrix.settings.target == 'i686-pc-windows-msvc'
run: yarn config set supportedArchitectures.cpu "ia32"
shell: bash
- name: Install dependencies
run: pnpm install
- name: Setup node x86
Expand All @@ -129,7 +139,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: bindings-${{ matrix.settings.target }}
path: ./packaegs/mako/${{ env.APP_NAME }}.*.node
path: ./packages/mako/${{ env.APP_NAME }}.*.node
if-no-files-found: error
publish:
name: Publish
Expand All @@ -154,13 +164,12 @@ jobs:
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: packaegs/mako/artifacts
path: packages/mako/artifacts
- name: Move artifacts
run: pnpm --filter @okamjs/okam artifacts
run: pnpm --filter @umijs/mako artifacts
- name: List packages
run: ls -R ./packaegs/mako/npm
run: ls -R ./packages/mako/npm
shell: bash

- name: Publish
run: |
if git log -1 --pretty=%B | grep "^Release [0-9]\+\.[0-9]\+\.[0-9]\+"; then
Expand Down