From 425b47ac91b5f7cab770543be0c7c11fceb7fd17 Mon Sep 17 00:00:00 2001 From: xiaohuoni Date: Tue, 20 Aug 2024 11:50:41 +0800 Subject: [PATCH 1/6] feat: build all platform by ci --- .github/workflows/node-bind-build.yml | 38 +++++++++++++++++---------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/node-bind-build.yml b/.github/workflows/node-bind-build.yml index c4bb265c6..2bcc3413f 100644 --- a/.github/workflows/node-bind-build.yml +++ b/.github/workflows/node-bind-build.yml @@ -1,7 +1,7 @@ name: node-bind-build env: DEBUG: napi:* - APP_NAME: okam + APP_NAME: mako MACOSX_DEPLOYMENT_TARGET: '10.13' 'on': push: @@ -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 }} @@ -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: @@ -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 @@ -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 @@ -154,11 +164,11 @@ 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 From 30c47dc2c1235dcb7a4d6956801fd3b21543b7d2 Mon Sep 17 00:00:00 2001 From: xiaohuoni Date: Tue, 20 Aug 2024 11:56:59 +0800 Subject: [PATCH 2/6] chore: release trigger build --- .github/workflows/node-bind-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/node-bind-build.yml b/.github/workflows/node-bind-build.yml index 2bcc3413f..19ae5e139 100644 --- a/.github/workflows/node-bind-build.yml +++ b/.github/workflows/node-bind-build.yml @@ -170,7 +170,6 @@ jobs: - name: List packages 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 From beb5ebacb3021d873071cdf1b84b43bfb01c9eb6 Mon Sep 17 00:00:00 2001 From: xiaohuoni Date: Tue, 20 Aug 2024 12:04:15 +0800 Subject: [PATCH 3/6] ci: release test ci --- .github/workflows/node-bind-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node-bind-build.yml b/.github/workflows/node-bind-build.yml index 19ae5e139..aed7b71fa 100644 --- a/.github/workflows/node-bind-build.yml +++ b/.github/workflows/node-bind-build.yml @@ -6,7 +6,7 @@ env: 'on': push: branches: - - master + - feat-build-all-platform-by-ci tags-ignore: - '**' paths-ignore: @@ -172,9 +172,9 @@ jobs: shell: bash - name: Publish run: | - 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 "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm --filter @okamjs/okam publish --access public + pnpm --filter @umijs/mako publish --access public else echo "Not a release, skipping publish" fi From 18e2b59c51cb882be9a8f7581eac043e184dffa4 Mon Sep 17 00:00:00 2001 From: xiaohuoni Date: Tue, 20 Aug 2024 12:08:52 +0800 Subject: [PATCH 4/6] release: test ci --- .github/workflows/node-bind-build.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/node-bind-build.yml b/.github/workflows/node-bind-build.yml index aed7b71fa..7747192c2 100644 --- a/.github/workflows/node-bind-build.yml +++ b/.github/workflows/node-bind-build.yml @@ -172,12 +172,7 @@ jobs: shell: bash - name: Publish run: | - if git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+"; then - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm --filter @umijs/mako publish --access public - else - echo "Not a release, skipping publish" - fi + echo "Not a release, skipping publish" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} From 6b2fd39b56f0c51a1efc7aac4390966f83f5deb6 Mon Sep 17 00:00:00 2001 From: xiaohuoni Date: Tue, 20 Aug 2024 12:12:24 +0800 Subject: [PATCH 5/6] fix: mako package name --- .github/workflows/node-bind-build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node-bind-build.yml b/.github/workflows/node-bind-build.yml index 7747192c2..d9aeefaf4 100644 --- a/.github/workflows/node-bind-build.yml +++ b/.github/workflows/node-bind-build.yml @@ -6,7 +6,7 @@ env: 'on': push: branches: - - feat-build-all-platform-by-ci + - master tags-ignore: - '**' paths-ignore: @@ -170,9 +170,15 @@ jobs: - name: List packages run: ls -R ./packages/mako/npm shell: bash + - name: Publish run: | - echo "Not a release, skipping publish" + if git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+"; then + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + pnpm --filter @umijs/mako publish --access public + else + echo "Not a release, skipping publish" + fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} From 226b81da99457cbdf98ba87cb00966ed70b1df78 Mon Sep 17 00:00:00 2001 From: xiaohuoni Date: Tue, 20 Aug 2024 17:36:41 +0800 Subject: [PATCH 6/6] fix: publish error --- .github/workflows/node-bind-build.yml | 4 ++-- packages/mako/package.json | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node-bind-build.yml b/.github/workflows/node-bind-build.yml index d9aeefaf4..cf6dc9c40 100644 --- a/.github/workflows/node-bind-build.yml +++ b/.github/workflows/node-bind-build.yml @@ -174,8 +174,8 @@ jobs: - name: Publish run: | if git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+"; then - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm --filter @umijs/mako publish --access public + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + pnpm --filter @umijs/mako publish --access public --no-git-checks else echo "Not a release, skipping publish" fi diff --git a/packages/mako/package.json b/packages/mako/package.json index a9b1c7833..14feb6d50 100644 --- a/packages/mako/package.json +++ b/packages/mako/package.json @@ -12,7 +12,9 @@ "defaults": false, "additional": [ "aarch64-apple-darwin", + "i686-pc-windows-msvc", "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl" ] @@ -78,4 +80,4 @@ "@umijs/mako-linux-x64-musl": "0.8.2" }, "repository": "git@github.com:umijs/mako.git" -} \ No newline at end of file +}