Skip to content

Commit

Permalink
Replace travis with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
orgads committed Feb 7, 2021
1 parent 101d4db commit 3186071
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 67 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/publish-native-assets-to-github-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow will prebuild native binaries for supported NodeJS versions, and add them to the Github release that triggered the workflow

name: Add native binaries to release

on:
release:
types: [created]
workflow_dispatch:

jobs:
augment-release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [8.x, 9.x, 10.x, 11.x, 12.x, 14.x]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: patch node gyp on windows to support Visual Studio 2019
if: matrix.os == 'windows-latest'
shell: powershell
run: |
npm install --global [email protected]
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
- name: build using node-pre-gyp
run: |
npm install --build-from-source
npx node-pre-gyp rebuild
npx node-pre-gyp package
- name: Upload native binaries for Node ${{ matrix.node-version }} for ${{ matrix.os }}
uses: csexton/release-asset-action@v2
with:
pattern: "build/stage/*.tar.gz"
github-token: ${{ secrets.GITHUB_TOKEN }}
release-url: ${{ github.event.release.upload_url }}

alpine-release:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12, 14]
container: node:${{ matrix.node-version }}-alpine3.12
steps:
- uses: actions/checkout@v2
- name: install build deps
run: |
apk add g++ make python2
- name: build using node-pre-gyp
run: |
npm install
npx node-pre-gyp rebuild
npx node-pre-gyp package
- name: Upload native binaries for Node ${{ matrix.node-version }} for alpine
uses: csexton/release-asset-action@v2
with:
pattern: "build/stage/*.tar.gz"
github-token: ${{ secrets.GITHUB_TOKEN }}
release-url: ${{ github.event.release.upload_url }}
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"install": "node-pre-gyp install --fallback-to-build",
"test": "mocha --expose-gc tests",
"example": "node --expose-gc example.js",
"prepublish": "npm ls",
"build": "node-pre-gyp build",
"pretest": "npm run build",
"clean": "node-pre-gyp clean",
Expand All @@ -36,10 +35,10 @@
],
"binary": {
"module_name": "gcstats",
"module_path": "./build/{module_name}/v{version}/{configuration}/{node_abi}-{platform}-{arch}/",
"module_path": "./build/{module_name}/v{version}/{configuration}/{node_abi}-{platform}-{arch}-{libc}",
"remote_path": "./{module_name}/v{version}/{configuration}/",
"package_name": "{node_abi}-{platform}-{arch}.tar.gz",
"host": "https://node-binaries.s3.amazonaws.com"
"package_name": "{node_abi}-{platform}-{arch}-{libc}.tar.gz",
"host": "https://github.com/adnanrahic/node-gcstats/releases/download/{version}"
},
"release-it": {
"github": {
Expand Down

0 comments on commit 3186071

Please sign in to comment.