fix(ci): Fix publish action for binaries (#6517)

This commit is contained in:
OJ Kwon 2022-11-26 20:39:42 -08:00 committed by GitHub
parent c82c65c0ba
commit 2ac32017ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,6 @@
#!/bin/sh
mkdir -p artifacts_cli
# Naive substitution to napi artifacts for the cli binary.
for filename in artifacts/*/*.node
do
@ -9,8 +10,10 @@ do
if [ -f "$CLI_BINARY_PATH" ]; then
chmod +x $CLI_BINARY_PATH
cp $CLI_BINARY_PATH artifacts_cli/$BINDING_ABI
mv $CLI_BINARY_PATH ./scripts/npm/$BINDING_ABI
elif [ -f "$CLI_BINARY_PATH.exe" ]; then
cp $CLI_BINARY_PATH.exe artifacts_cli/$BINDING_ABI
mv $CLI_BINARY_PATH.exe ./scripts/npm/$BINDING_ABI
fi
done

View File

@ -1,16 +1,18 @@
#!/bin/sh
# Naive substitution to napi artifacts for the cli binary.
for filename in artifacts/*/*.node
for filename in artifacts_cli/*/*
do
echo "Trying to upload $filename"
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
gh release upload $RELEASE_VERSION $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
gh release upload $RELEASE_VERSION $CLI_BINARY_PATH.exe
fi
done