diff --git a/.github/workflows/publish-npm-package.yml b/.github/workflows/publish-npm-package.yml index ff569a17381c..8f95b819601c 100644 --- a/.github/workflows/publish-npm-package.yml +++ b/.github/workflows/publish-npm-package.yml @@ -116,10 +116,14 @@ jobs: build: >- set -e && export CARGO_PROFILE_RELEASE_LTO=false && - RUSTFLAGS='-C target-feature=+sse2' cargo build --manifest-path ../../bindings/swc_cli/Cargo.toml --release --features plugin --target x86_64-unknown-linux-musl && - rm -rf target/release/.cargo-lock && - cp ../../bindings/target/x86_64-unknown-linux-musl/release/swc . && chmod +x ./swc && - RUSTFLAGS='-C target-feature=+sse2 -C target-feature=-crt-static' yarn build --target x86_64-unknown-linux-musl + if [[ ${{ inputs.package }} == "core" ]]; then + RUSTFLAGS='-C target-feature=+sse2' cargo build --manifest-path ../../bindings/swc_cli/Cargo.toml --release --features plugin --target x86_64-unknown-linux-musl && + rm -rf target/release/.cargo-lock && + cp ../../bindings/target/x86_64-unknown-linux-musl/release/swc . && chmod +x ./swc && + RUSTFLAGS='-C target-feature=+sse2 -C target-feature=-crt-static' yarn build --target x86_64-unknown-linux-musl + else + RUSTFLAGS='-C target-feature=+sse2 -C target-feature=-crt-static' yarn build --target x86_64-unknown-linux-musl + fi - host: macos-latest target: aarch64-apple-darwin build: | @@ -141,10 +145,15 @@ jobs: set -e && export JEMALLOC_SYS_WITH_LG_PAGE=16 && rustup target add aarch64-unknown-linux-gnu && - RUSTFLAGS='' cargo build --manifest-path ../../bindings/swc_cli/Cargo.toml --release --features plugin --target aarch64-unknown-linux-gnu && - cp ../../bindings/target/aarch64-unknown-linux-gnu/release/swc . && chmod +x ./swc && - export CC_aarch64_unknown_linux_gnu=/usr/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc && - yarn build --target aarch64-unknown-linux-gnu + if [[ ${{ inputs.package }} == "core" ]]; then + RUSTFLAGS='' cargo build --manifest-path ../../bindings/swc_cli/Cargo.toml --release --features plugin --target aarch64-unknown-linux-gnu && + cp ../../bindings/target/aarch64-unknown-linux-gnu/release/swc . && chmod +x ./swc && + export CC_aarch64_unknown_linux_gnu=/usr/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc && + yarn build --target aarch64-unknown-linux-gnu + else + export CC_aarch64_unknown_linux_gnu=/usr/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc && + yarn build --target aarch64-unknown-linux-gnu + fi - host: ubuntu-latest target: armv7-unknown-linux-gnueabihf build: |