Skip to content

Commit

Permalink
chore: Fix CLI upload script
Browse files Browse the repository at this point in the history
Closes #9511
  • Loading branch information
kdy1 committed Sep 11, 2024
1 parent 8b1e442 commit 6137b89
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ jobs:
ssh-private-key: ${{ secrets.SWC_BOT_SSH }}

publish-npm-stable:
name: "Publish ${{ matrix.package }}}}@${{ inputs.version || 'stable' }} to npm"
name: "Publish ${{ matrix.package }}@${{ inputs.version || 'stable' }} to npm"
strategy:
fail-fast: false
matrix:
Expand Down
13 changes: 10 additions & 3 deletions packages/core/scripts/cli_artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#!/bin/sh
set -eu

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%%.*}
# filename: artifacts/bindings-core-1.7.24-aarch64-apple-darwin/swc.darwin-arm64.node

# BINDING_NAME: darwin-arm64.node
# BINDING_ABI: darwin-arm64
# CLI_BINARY_PATH: artifacts/bindings-core-1.7.24-aarch64-apple-darwin/swc

BINDING_NAME=$(basename "$filename")
BINDING_ABI=$(echo "$BINDING_NAME" | sed 's/swc\.\(.*\)\.node/\1/')
CLI_BINARY_PATH=$(dirname "$filename")/swc

echo "Preparing build artifacts:"
echo "Binding name $BINDING_NAME"
Expand Down

0 comments on commit 6137b89

Please sign in to comment.