mirror of
https://github.com/swc-project/swc.git
synced 2024-11-23 17:54:15 +03:00
build(publish): Upload cli binaries to github release (#6495)
This commit is contained in:
parent
b90ea8ab8f
commit
4f8af16156
8
.github/workflows/publish-node.yml
vendored
8
.github/workflows/publish-node.yml
vendored
@ -464,3 +464,11 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Upload CLI binaries to gh release
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
|
||||
run: |
|
||||
./scripts/cli_upload_gh_release.sh
|
16
scripts/cli_upload_gh_release.sh
Executable file
16
scripts/cli_upload_gh_release.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 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%%.*}
|
||||
|
||||
if [ -f "$CLI_BINARY_PATH" ]; then
|
||||
chmod +x $CLI_BINARY_PATH
|
||||
gh release upload $RELEASE_VERSION ./scripts/npm/$BINDING_ABI/$CLI_BINARY_PATH
|
||||
elif [ -f "$CLI_BINARY_PATH.exe" ]; then
|
||||
gh release upload $RELEASE_VERSION ./scripts/npm/$BINDING_ABI/$CLI_BINARY_PATH/$CLI_BINARY_PATH.exe
|
||||
fi
|
||||
done
|
Loading…
Reference in New Issue
Block a user