Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(publish): upload cli binaries to gh release #6495

Merged
merged 1 commit into from Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/publish-node.yml
Expand Up @@ -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 changes: 16 additions & 0 deletions scripts/cli_upload_gh_release.sh
@@ -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