Skip to content

Commit

Permalink
Merge pull request #75 from openziti/fix-ci
Browse files Browse the repository at this point in the history
Drive publishing off Github releases
  • Loading branch information
ekoby authored Nov 1, 2023
2 parents eb21bc2 + a3ae323 commit fbf68f4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 157 deletions.
43 changes: 20 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
name: Build

on:
release:
types: [ published ]

push:
branches: [ main ]
paths-ignore:
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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'
Expand All @@ -138,30 +130,35 @@ jobs:
./build/Release/ziti_sdk_nodejs.node
if-no-files-found: error
- name: upload release bundle
uses: softprops/[email protected]
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 }}
aws-region: us-east-1

- 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
Expand All @@ -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/')
99 changes: 0 additions & 99 deletions .travis.yml-obsolete

This file was deleted.

32 changes: 0 additions & 32 deletions appveyor.yml-obsolete

This file was deleted.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit fbf68f4

Please sign in to comment.