Skip to content

Commit

Permalink
more scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes committed Sep 26, 2023
1 parent 7600c37 commit 1abb683
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
21 changes: 21 additions & 0 deletions scripts/install_node.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

if [[ ${1:-false} == 'false' ]]; then
echo "Error: pass node version as first argument"
exit 1
fi

NODE_VERSION=$1

# if an existing nvm is already installed we need to unload it
nvm unload || true

# here we set up the node version on the fly based on the matrix value.
# This is done manually so that the build works the same on OS X
rm -rf ./__nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ./__nvm
source ./__nvm/nvm.sh
nvm install ${NODE_VERSION}
nvm use --delete-prefix ${NODE_VERSION}
node --version
npm --version
which node
5 changes: 3 additions & 2 deletions scripts/node_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ fi
export PATH=$(npm bin):$PATH
./node_modules/.bin/node-pre-gyp package testpackage testbinary --target_arch="$TARGET_ARCH"
if [[ "$GITHUB_REF" =~ ^(refs/heads/main|refs/tags/v.+)$ ]] ; then
./node_modules/.bin/node-pre-gyp publish --target_arch=$TARGET_ARCH
./node_modules/.bin/node-pre-gyp info --target_arch=$TARGET_ARCH
echo "UPLOAD"
# TODO ./node_modules/.bin/node-pre-gyp publish --target_arch=$TARGET_ARCH
# TODO ./node_modules/.bin/node-pre-gyp info --target_arch=$TARGET_ARCH
fi
5 changes: 3 additions & 2 deletions scripts/node_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ npm pack --dry-run

# upload to npm, maybe
if [[ "$GITHUB_REF" =~ ^(refs/heads/main|refs/tags/v.+)$ && "$1" = "upload" ]] ; then
npm config set //registry.npmjs.org/:_authToken $NODE_AUTH_TOKEN
npm publish --access public $TAG
echo "UPLOAD"
# npm config set //registry.npmjs.org/:_authToken $NODE_AUTH_TOKEN
# npm publish --access public $TAG
fi

0 comments on commit 1abb683

Please sign in to comment.