Skip to content

Commit be7dbde

Browse files
committed
pass through target
1 parent d240f30 commit be7dbde

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

.github/workflows/turborepo-library-release.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
dry_run:
7-
description: "Do a dry run, skipping the final publish step."
7+
description: Do a dry run, skipping the final publish step.
88
type: boolean
99

1010
jobs:
@@ -18,12 +18,13 @@ jobs:
1818
matrix:
1919
settings:
2020
- host: macos-latest
21-
target: "aarch64-apple-darwin"
21+
target: aarch64-apple-darwin
22+
2223
- host: macos-latest
23-
target: "x86_64-apple-darwin"
24+
target: x86_64-apple-darwin
2425

2526
- host: ubuntu-latest
26-
target: "aarch64-unknown-linux-gnu"
27+
target: aarch64-unknown-linux-gnu
2728
setup: |
2829
sudo apt update
2930
sudo apt install -y g++-aarch64-linux-gnu libc6-dev-arm64-cross
@@ -32,7 +33,7 @@ jobs:
3233
echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV
3334
3435
- host: ubuntu-latest
35-
target: "x86_64-unknown-linux-gnu"
36+
target: x86_64-unknown-linux-gnu
3637
container: amazon/aws-lambda-nodejs:20
3738
install: |
3839
microdnf install -y gcc gcc-c++ git
@@ -42,7 +43,7 @@ jobs:
4243
pnpm install
4344
4445
- host: ubuntu-latest
45-
target: "x86_64-unknown-linux-musl"
46+
target: x86_64-unknown-linux-musl
4647
container: ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2023-09-17-alpine
4748
install: |
4849
apk update && apk upgrade
@@ -56,7 +57,7 @@ jobs:
5657
pnpm install
5758
5859
- host: ubuntu-latest
59-
target: "aarch64-unknown-linux-musl"
60+
target: aarch64-unknown-linux-musl
6061
container: ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2023-09-17-alpine
6162
install: |
6263
apk update && apk upgrade
@@ -73,10 +74,10 @@ jobs:
7374
rust_env: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc RUSTFLAGS="-Ctarget-feature=-crt-static"
7475

7576
- host: windows-latest
76-
target: "aarch64-pc-windows-msvc"
77+
target: aarch64-pc-windows-msvc
7778

7879
- host: windows-latest
79-
target: "x86_64-pc-windows-msvc"
80+
target: x86_64-pc-windows-msvc
8081

8182
runs-on: ${{ matrix.settings.host }}
8283
container:
@@ -123,7 +124,7 @@ jobs:
123124
path: packages/turbo-repository/native
124125

125126
package:
126-
name: "Publish to NPM"
127+
name: Publish to NPM
127128
runs-on: ubuntu-latest
128129
needs: [build]
129130
steps:

packages/turbo-repository/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"bugs": "https://github.com/vercel/turborepo/issues",
66
"homepage": "https://turbo.build/repo",
77
"scripts": {
8-
"build": "bash scripts/build.sh",
9-
"build:release": "bash scripts/build.sh release",
8+
"build": "bash scripts/build.sh --dts ../js/index.d.ts",
9+
"build:release": "bash scripts/build.sh --release",
1010
"package": "node scripts/publish.mjs",
1111
"test": "node --import tsx --test __tests__/*.test.ts"
1212
},

packages/turbo-repository/scripts/build.sh

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

3-
flags="\
3+
user_provided_flags="$@"
4+
script_provided_flags="\
45
--platform \
56
-p turborepo-napi \
67
--cargo-cwd ../../ \
@@ -9,13 +10,7 @@ flags="\
910
--js false \
1011
"
1112

12-
if [ "$1" == "release" ]; then
13-
flags+=" --release"
14-
else
15-
flags+=" --dts ../js/index.d.ts"
16-
fi
17-
18-
node_modules/.bin/napi build $flags
13+
node_modules/.bin/napi build "$user_provided_flags" "$script_provided_flags"
1914

2015
# Unfortunately, when napi generates a .d.ts file, it doesn't match our formatting rules (it doesn't have semicolons).
2116
# Since there's now way to configure this from napi itself, so we need to run prettier on it after generating it.

0 commit comments

Comments
 (0)