Skip to content

Commit 2583a02

Browse files
committed
chore: debug in pr
1 parent ece54f6 commit 2583a02

12 files changed

Lines changed: 108 additions & 372 deletions

File tree

.github/actions/docker-build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ runs:
5050
echo "Corepack version: $(corepack --version)"
5151
corepack enable
5252
53-
RUST_TARGET=${{ inputs.target }} ${{ inputs.plugin == 'false' && 'DISABLE_PLUGIN=1' || '' }} pnpm build:binding:${{ inputs.profile }}
53+
RUST_TARGET=${{ inputs.target }} ${{ inputs.plugin == 'false' && 'DISABLE_PLUGIN=1' || '' }} pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }}
5454
${{ inputs.post }}
5555
'
5656
if [[ ! -n "$CARGO_HOME" ]]; then

.github/workflows/release-npm.yml

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
name: Release Full
22

33
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
paths-ignore:
7+
- '**/*.md'
8+
49
workflow_dispatch:
510
inputs:
611
tag:
712
type: choice
813
description: "Release Npm Tag"
9-
required: true
14+
required: false
1015
default: "latest"
1116
options:
1217
- canary
@@ -17,17 +22,17 @@ on:
1722
test:
1823
type: boolean
1924
description: "Run tests before release"
20-
required: true
21-
default: true
25+
required: false
26+
default: false
2227
dry_run:
2328
type: boolean
2429
description: "DryRun release"
25-
required: true
30+
required: false
2631
default: false
2732
push_tags:
2833
type: boolean
2934
description: "push tags to github"
30-
required: true
35+
required: false
3136
default: true
3237

3338
permissions:
@@ -43,18 +48,29 @@ jobs:
4348
matrix:
4449
array:
4550
- target: x86_64-unknown-linux-gnu
51+
runner: "ubuntu-22.04"
4652
- target: aarch64-unknown-linux-gnu
53+
runner: "ubuntu-22.04"
4754
- target: x86_64-unknown-linux-musl
55+
runner: "ubuntu-22.04"
4856
- target: aarch64-unknown-linux-musl
57+
runner: "ubuntu-22.04"
4958
- target: i686-pc-windows-msvc
59+
runner: "windows-latest"
5060
- target: x86_64-pc-windows-msvc
61+
runner: "windows-latest"
5162
- target: aarch64-pc-windows-msvc
63+
runner: "windows-latest"
5264
- target: x86_64-apple-darwin
65+
runner: "macos-latest"
5366
- target: aarch64-apple-darwin
67+
runner: "macos-latest"
68+
5469
uses: ./.github/workflows/reusable-build.yml
5570
with:
5671
target: ${{ matrix.array.target }}
57-
test: ${{ inputs.test }}
72+
runner: ${{ matrix.array.runner }}
73+
test: false
5874
profile: "release"
5975

6076
release:
@@ -65,7 +81,7 @@ jobs:
6581
id-token: write
6682
runs-on: ubuntu-latest
6783
needs: build
68-
if: ${{ github.event_name == 'workflow_dispatch' }}
84+
# if: ${{ github.event_name == 'workflow_dispatch' }}
6985
steps:
7086
- name: Checkout Repo
7187
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -74,25 +90,30 @@ jobs:
7490
fetch-depth: 1
7591

7692
- name: Pnpm Setup
77-
uses: ./.github/actions/pnpm/setup
93+
uses: ./.github/actions/pnpm
7894

7995
- name: Download artifacts
8096
uses: actions/download-artifact@v4.1.7
8197
with:
8298
path: artifacts
8399

84-
- name: Build node packages
85-
run: pnpm run build:js
100+
- name: ls
101+
run: ls -R artifacts
86102

87103
- name: Move artifacts
88-
run: node scripts/build-npm.cjs
104+
run: |
105+
pnpm napi create-npm-dirs --package-json-path npm/package.json --npm-dir bindings
106+
pnpm napi artifacts --package-json-path npm/package.json --npm-dir bindings --build-output-dir napi
89107
90108
- name: Show binding packages
91-
run: ls -R npm
92-
93-
- name: Link optional dependencies
94-
run: pnpm install --no-frozen-lockfile
109+
run: ls -R bindings
95110

111+
- name: Publish All
112+
run: |
113+
git status
114+
cp napi/{index,browser}.js npm
115+
cp napi/index.d.ts npm
116+
pnpm publish -r --dry-run --no-git-checks
96117
# - name: Release Full
97118
# run: |
98119
# ./x publish stable --tag ${{inputs.tag}} ${{inputs.dry_run && '--dry-run' || '--no-dry-run'}} ${{inputs.push_tags && '--push-tags' || '--no-push-tags'}}

.github/workflows/reusable-build.yml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ name: Reusable Release
33
on:
44
workflow_call:
55
inputs:
6-
skipable:
7-
required: false
8-
type: boolean
9-
default: false
106
target:
117
required: true
128
type: string
9+
runner:
10+
default: "ubuntu-22.04"
11+
required: false
12+
type: string
1313
full-install:
1414
default: true
1515
required: false
@@ -41,7 +41,7 @@ permissions:
4141
jobs:
4242
build:
4343
name: Build
44-
runs-on: ${{ fromJSON(inputs.runner) }}
44+
runs-on: ${{ inputs.runner }}
4545
defaults:
4646
run:
4747
shell: bash
@@ -53,21 +53,18 @@ jobs:
5353
with:
5454
ref: ${{ inputs.ref }}
5555

56-
- name: Clean
57-
uses: ./.github/actions/clean
58-
with:
59-
target: ${{ inputs.target }}
60-
6156
- name: Pnpm Setup
6257
uses: ./.github/actions/pnpm
6358

6459
- uses: Boshen/setup-rust@main
6560
with:
61+
save-cache: true
6662
cache-key: build-${{ inputs.target }}-${{ inputs.profile }}
6763

6864
- name: Trim paths
6965
shell: bash
7066
run: |
67+
mkdir -p .cargo
7168
echo $'\n' >> .cargo/config.toml
7269
echo '[unstable]' >> .cargo/config.toml
7370
echo 'trim-paths = true' >> .cargo/config.toml
@@ -129,21 +126,21 @@ jobs:
129126
# Windows
130127
- name: Build i686-pc-windows-msvc
131128
if: ${{ inputs.target == 'i686-pc-windows-msvc' }}
132-
run: RUST_TARGET=${{ inputs.target }} DISABLE_PLUGIN=1 pnpm build:binding:${{ inputs.profile }}
129+
run: RUST_TARGET=${{ inputs.target }} DISABLE_PLUGIN=1 pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }}
133130

134131
- name: Build x86_64-pc-windows-msvc
135132
if: ${{ inputs.target == 'x86_64-pc-windows-msvc' }}
136-
run: RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }}
133+
run: RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }}
137134

138135
- name: Build aarch64-pc-windows-msvc
139136
if: ${{ inputs.target == 'aarch64-pc-windows-msvc' }}
140-
run: RUST_TARGET=${{ inputs.target }} DISABLE_PLUGIN=1 pnpm build:binding:${{ inputs.profile }}
137+
run: RUST_TARGET=${{ inputs.target }} DISABLE_PLUGIN=1 pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }}
141138

142139
# Mac
143140
- name: Build x86_64-apple-darwin
144141
if: ${{ inputs.target == 'x86_64-apple-darwin' }}
145142
run: |
146-
RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }}
143+
RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }}
147144
148145
- name: Build aarch64-apple-darwin
149146
if: ${{ inputs.target == 'aarch64-apple-darwin' }}
@@ -153,17 +150,15 @@ jobs:
153150
export CXX=$(xcrun -f clang++);
154151
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
155152
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
156-
RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }}
153+
RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }}
157154
158155
- name: Upload artifact
159156
id: upload-artifact
160157
uses: ./.github/actions/artifact/upload
161158
if: ${{ inputs.target != 'wasm32-wasip1-threads' }}
162159
with:
163160
name: bindings-${{ inputs.target }}
164-
path: crates/node_binding/*.node
165-
try-local-cache: ${{ inputs.profile == 'ci' }}
166-
mv-when-local: true
161+
path: napi/resolver*.node
167162

168163
# WASM
169164
- name: Build wasm32-wasip1-threads with linux in Docker
@@ -182,6 +177,4 @@ jobs:
182177
if: ${{ inputs.target == 'wasm32-wasip1-threads' }}
183178
with:
184179
name: bindings-wasm32-wasi
185-
path: crates/node_binding/rspack.wasm32-wasi.wasm
186-
try-local-cache: ${{ inputs.profile == 'ci' }}
187-
mv-when-local: true
180+
path: napi/resolver*.wasm

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
target/
22
node_modules
33
fuzz/Cargo.lock
4+
artifacts
5+
bindings

fixtures/pnpm-workspace/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "monorepo",
3+
"private": "true",
34
"version": "1.0.0",
45
"description": "",
56
"main": "index.js",

napi/browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from '@oxc-resolver/binding-wasm32-wasi'
1+
export * from '@rspack/resolver-binding-wasm32-wasi'

0 commit comments

Comments
 (0)