-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): Fix publish action (#9463)
- Loading branch information
Showing
5 changed files
with
43 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,10 +173,14 @@ jobs: | |
export JEMALLOC_SYS_WITH_LG_PAGE=16 && | ||
rustup toolchain install $(cat ../../rust-toolchain) && | ||
rustup target add aarch64-unknown-linux-musl && | ||
RUSTFLAGS='-C target-feature=+crt-static -C link-arg=-lgcc' cargo build --manifest-path ../../bindings/swc_cli/Cargo.toml --release --features plugin --target aarch64-unknown-linux-musl && | ||
rm -rf target/release/.cargo-lock && | ||
cp ../../bindings/target/aarch64-unknown-linux-musl/release/swc . && chmod +x ./swc && | ||
env RUSTFLAGS='-C target-feature=-crt-static' yarn build --target=aarch64-unknown-linux-musl | ||
if [[ ${{ inputs.package }} == "core" ]]; then | ||
RUSTFLAGS='-C target-feature=+crt-static -C link-arg=-lgcc' cargo build --manifest-path ../../bindings/swc_cli/Cargo.toml --release --features plugin --target aarch64-unknown-linux-musl && | ||
rm -rf target/release/.cargo-lock && | ||
cp ../../bindings/target/aarch64-unknown-linux-musl/release/swc . && chmod +x ./swc && | ||
env RUSTFLAGS='-C target-feature=-crt-static' yarn build --target=aarch64-unknown-linux-musl | ||
else | ||
env RUSTFLAGS='-C target-feature=-crt-static' yarn build --target=aarch64-unknown-linux-musl | ||
fi | ||
- host: windows-latest | ||
target: aarch64-pc-windows-msvc | ||
# Disable `LTO` and increase `codegen-units` to avoid llvm `OOM` on GitHub Actions. | ||
|
@@ -362,7 +366,7 @@ jobs: | |
- name: Build TypeScript | ||
run: yarn build:ts | ||
- name: Test bindings | ||
run: docker run --rm -v $(pwd):/swc -w /swc node:${{ matrix.node }}-slim sh -c 'npm install -f -g [email protected] && cd ./packages/${{ inputs.package }} && env DISABLE_PLUGIN_E2E_TESTS=true yarn test' | ||
run: docker run --rm -v $(pwd):/swc -w /swc node:${{ matrix.node }}-slim sh -c 'npm install -f -g [email protected] && env DISABLE_PLUGIN_E2E_TESTS=true yarn test:${{ inputs.package }}' | ||
test-linux-x64-musl-binding: | ||
name: Test bindings on x86_64-unknown-linux-musl - node@${{ matrix.node }} | ||
needs: | ||
|
@@ -402,7 +406,7 @@ jobs: | |
- name: Build TypeScript | ||
run: yarn build:ts | ||
- name: Test bindings | ||
run: docker run --rm -v $(pwd):/swc -w /swc node:${{ matrix.node }}-alpine sh -c 'npm install -f -g [email protected] && cd ./packages/${{ inputs.package }} && env DISABLE_PLUGIN_E2E_TESTS=true yarn test' | ||
run: docker run --rm -v $(pwd):/swc -w /swc node:${{ matrix.node }}-alpine sh -c 'npm install -f -g [email protected] && env DISABLE_PLUGIN_E2E_TESTS=true yarn test:${{ inputs.package }}' | ||
# test-linux-aarch64-musl-binding: | ||
# name: Test bindings on aarch64-unknown-linux-musl - node@lts | ||
# needs: | ||
|
@@ -529,7 +533,6 @@ jobs: | |
shell: bash | ||
|
||
- name: Move binaries | ||
if: inputs.package == 'core' | ||
shell: bash | ||
working-directory: ./packages/${{ inputs.package }} | ||
run: | | ||
|
@@ -559,7 +562,7 @@ jobs: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Upload CLI binaries to gh release | ||
if: ${{ !inputs.skipPublishing }} | ||
if: ${{ !inputs.skipPublishing && inputs.package == 'core' }} | ||
shell: bash | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
mkdir -p ./artifacts_cli | ||
# Naive substitution to napi artifacts for the cli binary. | ||
for filename in artifacts/*/*.node | ||
do | ||
BINDING_NAME=${filename#*.} | ||
BINDING_ABI=${BINDING_NAME%%.*} | ||
CLI_BINARY_PATH=${filename%%.*} | ||
|
||
echo "Preparing build artifacts:" | ||
echo "Binding name $BINDING_NAME" | ||
echo "Filename $filename" | ||
echo "Cli binary path $CLI_BINARY_PATH" | ||
|
||
if [ -f "$CLI_BINARY_PATH" ]; then | ||
chmod +x $CLI_BINARY_PATH | ||
mv -v $CLI_BINARY_PATH ./artifacts_cli/swc-$BINDING_ABI | ||
elif [ -f "$CLI_BINARY_PATH.exe" ]; then | ||
mv -v $CLI_BINARY_PATH.exe ./artifacts_cli/swc-$BINDING_ABI.exe | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters