From 1abb68364832b9a56c49d857ef0706517fb9d411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20M=C3=BChleisen?= Date: Tue, 26 Sep 2023 16:43:32 +0200 Subject: [PATCH] more scripts --- scripts/install_node.sh | 21 +++++++++++++++++++++ scripts/node_build.sh | 5 +++-- scripts/node_version.sh | 5 +++-- 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100755 scripts/install_node.sh diff --git a/scripts/install_node.sh b/scripts/install_node.sh new file mode 100755 index 00000000..247fd74d --- /dev/null +++ b/scripts/install_node.sh @@ -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 \ No newline at end of file diff --git a/scripts/node_build.sh b/scripts/node_build.sh index 41f2346b..b4676f26 100755 --- a/scripts/node_build.sh +++ b/scripts/node_build.sh @@ -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 diff --git a/scripts/node_version.sh b/scripts/node_version.sh index 55657906..c6874019 100755 --- a/scripts/node_version.sh +++ b/scripts/node_version.sh @@ -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