diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44e016c..3f4232b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,9 @@ name: Build on: + release: + types: [ published ] + push: branches: [ main ] paths-ignore: @@ -41,7 +44,7 @@ jobs: - { os: ubuntu-20.04, target: "linux", arch: "x64" } - { os: ubuntu-20.04, target: "linux", arch: "arm64" } - { os: macos-latest, target: "macos", arch: "x64" } - - { os: ubuntu-20.04, target: "linux", arch: "arm64" } + - { os: macos-latest, target: "macos", arch: "arm64" } node_ver: [ 16, 18, 19, 20] fail-fast: false @@ -104,26 +107,15 @@ jobs: run: | npm --version - - - name: Build NodeJS-SDK (Linux | Mac) + - name: Build NodeJS-SDK run: | cd ${{ runner.workspace }}/${{ github.event.repository.name }} npm install + npm run build:package -- --target_arch=${{ matrix.config.arch }} env: PRESET: ci-${{ matrix.config.target }}-${{ matrix.config.arch }} TARGET_ARCH: ${{ matrix.config.arch }} BUILD_DATE: ${{ steps.date.outputs.date }} -# if: | -# matrix.config.os == 'ubuntu-20.04' || -# matrix.config.os == 'macOS-latest' - -# disabled for now -# - name: Build NodeJS-SDK (Windows) -# run: | -# cd ${{ runner.workspace }}/${{ github.event.repository.name }} -# npm install --build-from-source --cd=%CD% -# if: | -# matrix.config.os == 'windows-latest' - name: Hello test if: matrix.config.arch == 'x64' @@ -138,9 +130,16 @@ jobs: ./build/Release/ziti_sdk_nodejs.node if-no-files-found: error + - name: upload release bundle + uses: softprops/action-gh-release@v0.1.13 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + ./build/stage/**/ziti_sdk_nodejs*.tar.gz + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 - if: env.AWS_KEY_ID != '' + if: env.AWS_KEY_ID != '' && startsWith(github.ref, 'refs/tags/') with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -148,20 +147,18 @@ jobs: - name: Publish Binary to S3 (for all OS's, Node versions, and architectures) run: | - ./node_modules/.bin/node-pre-gyp package unpublish publish + ./node_modules/.bin/node-pre-gyp --target_arch=${{ matrix.config.arch }} unpublish publish sleep 5 - if: | - steps.extract_branch.outputs.branch == 'main' && !(matrix.config.os == 'ubuntu-20.04' && matrix.config.node == '16' && matrix.config.arch == 'x64' && steps.extract_branch.outputs.branch == 'main') + if: startsWith(github.ref, 'refs/tags/') - name: Install Binary run: | - npm install --fallback-to-build=false > /dev/null + npm install --fallback-to-build=false sleep 5 - if: | - steps.extract_branch.outputs.branch == 'main' + if: startsWith(github.ref, 'refs/tags/') - name: Fetch Binary info - if: env.AWS_KEY_ID != '' + if: env.AWS_KEY_ID != '' && startsWith(github.ref, 'refs/tags/') run: | ./node_modules/.bin/node-pre-gyp info @@ -171,4 +168,4 @@ jobs: token: ${{ secrets.NPM_TOKEN }} access: public if: | - matrix.config.os == 'ubuntu-20.04' && matrix.config.node == '16' && matrix.config.arch == 'x64' && steps.extract_branch.outputs.branch == 'main' + matrix.config.os == 'ubuntu-20.04' && matrix.node_ver == '20' && matrix.config.arch == 'x64' && startsWith(github.ref, 'refs/tags/') diff --git a/.travis.yml-obsolete b/.travis.yml-obsolete deleted file mode 100644 index 7f833a9..0000000 --- a/.travis.yml-obsolete +++ /dev/null @@ -1,99 +0,0 @@ -language: c -compiler: -- gcc -git: - depth: 10 - submodules: false -matrix: - include: - - os: osx - osx_image: xcode11.2 - compiler: gcc - addons: - homebrew: - packages: - - ninja - update: true - env: - - NODE_VERSION="14.15.3" - - os: osx - osx_image: xcode11.2 - compiler: gcc - addons: - homebrew: - packages: - - ninja - update: true - env: - - NODE_VERSION="13.12.0" - - os: osx - osx_image: xcode11.2 - compiler: gcc - addons: - homebrew: - packages: - - ninja - update: true - env: NODE_VERSION="12.16.0" - - os: linux - dist: focal - compiler: gcc - env: - - NODE_VERSION="13.12.0" - - DO_NPM_PUBLISH=true - addons: - apt: - packages: - - ninja-build - - os: linux - dist: focal - compiler: gcc - env: NODE_VERSION="12.16.0" - addons: - apt: - packages: - - ninja-build -env: - global: - - secure: vWZAh/2fhkmV5p5uW7CIqb3KsrXsQhDuiK75hQiRJWBozSHXF1Um/oFmPbT2MGi4Zgo8YZBprrb0lECRFrtzEsTjrhYbCtCGzv4Y1hiIZ0dPl0+vU1yTzHO9FMYohWagXFQNDrWfaLBCIttuNIrH55TiX4Ud9gEoQOFisuyFg/3lE/wKPL55/jaPH9KjpiN1Lv5yFUw4FwYRD57cL6FXOf/9tCkMVmVWU1mHElkkjqhanYqXWkVJ6w/hicu+hsOqV00/jtWJGXLv4lGJLQFgVTHUZDvuXShlIfIyixbsLbS0HbXmHBmxHxl5uAFGeMV8iq+Xf8AHBFQ0IL2T00Grw/8BomIK/Tit+1FDVeIt5yLw4UQP0z6T4Ds6w7jQZDNfaCrTEYbaDi9NF4wWOsoJWTFDSbuYRXwWJ3/r5BSPjPSPv4rDIMQxCt67vYgzOtmwtzkDTi1BciaDzfI+ZWjAIAszGCRsPEfZLdprYnc3SQQ1KTHiR3QZNSq9WElojhRU7+99LeXMYjVW1awb3u9DAx1+u8zSS2xAzOobNjj7lE47M71wIOoFf//kPjwHTdPhzGmi276nFOjqN7h3b45/mOLFngeyjvOlb3nkGx/3oZGt5pZZJaZFZuRxDndO1FP3DoJUozVVvt/91aXGNoUPz7QrtM+BwtLEUVhcTQvnAvg= - - secure: jqUCQcHHFWnOcAgbYs/iSk25Jjel+CLcfdsuoFeIHFGpB0c3TaDk9TK1rQGOjnpc7Qd04dGxJEg5PM3qEhvVoZD+CGVVuSDJSmwwMGnDDl72B9vpmG2sFJg95rvQevju6pgWK5FdqgqvzWwoEaAk9rugcKFa6pB73O9ByA5zVC+G5J0CfcUmgVWs2NWuBGuBiUgBvSEblsYvIF7ic5gUd8DNhF36BdkR0GpJFFG1ZQYtujmp8bqdLJW14Ob7yeOj6cID+iOjkAFdMD94BBQLqiPbQuso3waa/Pp884VAhNZRWMtefEL7hPfFuRI5UbRLwPa+R0IDi69/rgAx5AMAIFYUUxrZSR0LcMwLZCQx0ThETxHtYih7Gsi/2I5sGHzf8jeD5aVFPZVGXb2uOKBF2iDidvzyLfdCxpyECmaTXBPBmy7mGYmQvKltzMTvlVM3czZaXhs6FWCB8sSmFox1zI25Rr/CZCy+c1qRJ8Wi64R3FSv1MBxnGBfT5iSilv7X5cK0WlmoGnb6NCgmP1oDwzaHyUT1sOhRPg8CJeOf601xr03oVE8VvsgTOMVTumgDMjLtrS60iV7SKK3fzdcl0nGyBDjdAC8pApZSunVMGZNc0DSrokl9U57LWHqSosEQvXf89jOxfyao+ynn/t6RtmJabH5hTDy0ViqRljYvfII= -before_install: -- scripts/validate_tag.sh -- source ./scripts/install_node.sh ${NODE_VERSION} -- gcc --version -- cmake --version -- ninja --version -- node --version -- npm --version -- COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n') -- export PATH=./node_modules/.bin/:$PATH -- npm install node-gyp -g -- PUBLISH_BINARY=false -- if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then PUBLISH_BINARY=true; fi; -- if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then PUBLISH_BINARY=true; fi; -install: -- git submodule update --init --recursive -- npm run build:init -- npm run build:c-sdk -- npm install --build-from-source -- node tests/hello.js -- npm run build:cleanup -before_script: -- if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp package publish && sleep 10; fi; -script: -- sleep 5 -- INSTALL_RESULT=0 -- if [[ $PUBLISH_BINARY == true ]]; then INSTALL_RESULT=$(npm install --fallback-to-build=false > /dev/null)$? || true; fi; -- if [[ $INSTALL_RESULT != 0 ]]; then echo "returned $INSTALL_RESULT";node-pre-gyp unpublish;false; fi -after_success: -- node-pre-gyp info -deploy: - provider: npm - edge: true - email: curt.tudor@netfoundry.io - api_key: - secure: u9BzMSC2P7P/MwQxS6pHneEXSnVRUovzwjgiKEpT1pUvkqTNyUjfycdFVLuH98WKS9V5B+ipOolV1oon66ohl55Gc0I6C9uWtVPPOxNv3l2tq8NsDnO+9y1fZYfjInGxoeBua83HTb1GT4w7TaT2HxHMXqfYtISKlcwdTTFxDRZnnmq2CH/m2/HQM5lwnD1A8ptrP9CDfnnfb1IS06YgxBkT31sK5Z2m7zTBx/qNdCyIKDBVnZwzHE7COzUljrycgUAsLVdep3vs0UcaIB33Nyja+T3GKNagPQQUE47KYFEZ4omaFJJsF1JCwqxzZzjqH2uGe9xtJfDbAfgkouV2hc4EcdIsgy1Bmj1fSLS3U+HHRviouhNnSKXD8t4X/xiactcyydBrFiA+25B9lpftCvQ8l/UP8fqz9Uo5iy4ZklnUq8OPhM/AhAhke86DHagi7LwEYRHMzd9d1Z61YgYqduMbe7MUmZZY9HPADFdnMOs48ZzEuQvyEaK0JHjXhhmuLHLIyYbn52QlAppEJ35iJJls+3h4PxtVTHjk3r8pNs50SMp7iHJObGL1drMCAosSq+f5r/cEa/KRgwHpv+OIs2aZtqiV2DlygB39aNWMTIx0l4YAhpgnNYgWEbi/6YqHE/uKm5Rh7ExoygZEhDa/IYl79iyroS/teYWi9KK4qso= - on: - tags: true - branch: master - condition: "$DO_NPM_PUBLISH = true" diff --git a/appveyor.yml-obsolete b/appveyor.yml-obsolete deleted file mode 100644 index 8bf1711..0000000 --- a/appveyor.yml-obsolete +++ /dev/null @@ -1,32 +0,0 @@ - platform: - - x64 - - configuration: - - Debug - - image: - - Visual Studio 2019 - - environment: - AWS_ACCESS_KEY_ID: - secure: GIQzwkV21ZqWhzZ0ii13r4dOEZ6Pkq8r6Jajx18uEaY= - AWS_SECRET_ACCESS_KEY: - secure: 7sxn6236C/oltJYJfel3ISUxQfuBfB44QqdWs0Thjy+U3s+6MPugW8CGVlC8p0o8 - - matrix: - - nodejs_version: 11 - platform: x64 - - nodejs_version: 12 - platform: x64 - - nodejs_version: 13 - platform: x64 - - nodejs_version: 14 - platform: x64 - - install: - - scripts\build-appveyor.bat - - ps: if($env:appveyor_repo_tag -eq 'True') { npm run publish } else { echo "Not publishing binary because this is not a tag build" } - - build: OFF - test: OFF - deploy: OFF \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 363f189..74f48e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openziti/ziti-sdk-nodejs", - "version": "0.13.3", + "version": "0.14.0-dev", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openziti/ziti-sdk-nodejs", - "version": "0.13.3", + "version": "0.14.0-dev", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 36d2e2f..81a8e38 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@openziti/ziti-sdk-nodejs", "description": "A NodeJS-based SDK for delivering secure applications over a Ziti Network", - "version": "0.14.0-dev", + "version": "0.14.0", "main": "./lib/ziti", "scripts": { "build": "npm run build:init && npm run build:configure && npm run build:make", @@ -10,6 +10,7 @@ "build:configure:windows": "configure", "build:configure:linux:darwin": "./configure", "build:make": "cmake-js build", + "build:package": "node-pre-gyp package", "clean": "cmake-js clean", "test": "echo \"Error: no test specified\"", "install": "node-pre-gyp install || npm run build",