diff --git a/.github/workflows/publish-native-assets-to-github-releases.yml b/.github/workflows/publish-native-assets-to-github-releases.yml new file mode 100644 index 0000000..145fd66 --- /dev/null +++ b/.github/workflows/publish-native-assets-to-github-releases.yml @@ -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 node-gyp@5.1.1 + 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 }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fb01578..0000000 --- a/.travis.yml +++ /dev/null @@ -1,63 +0,0 @@ -language: node_js -node_js: -- '8' -- '9' -- '10' -- '11' -- '12' -- '13' -- '14' - -env: - matrix: - - CXX=g++-4.8 - global: - - secure: jczVFyYpDneWRFonk5M1eu8nQ6D/Mmc97zq72a+vxyZGOlS5mw0iShJgTJ0gRqmolx3/wSWEEyTJEiDKcXRg/NmpFnSevD+pA3pYQVYxlk7aYrJUGDSF5l/0QsCxhvc7rou61z8biTx2575zzyqokB18KTJeLh7qxGXFe6b/FQQ= - - secure: XjkMU0jsr20zPanIGr10syio9KMmO1HO6JAAEv7d8sP7y+W20GZZ+fKSvZaTZetdgVxzZcwjeoKGVBSZb/4XDZr9JgtmDAoR8UPsZIzMUv1/+b7VprzBypt36T2bcOfsOEtiRj+Sg+fAzpsBixr/1x4gJSbrOAqtc9/abbz+PRE= - - secure: j/QpC1XWcZSTqFHpnptJY0X3jPrZsqkqikaSo/eo4brxie/8CFLez1oQ6suvXq0wTozF+ivx3ZCCWeGyN0rfNpsCuD+E0hTSUXLeab1CZNCKOqlMnNcr6Gs4IV5giWbGPVUiL/dvKNje7gEWFTPPjUB0OVZ/1EiKqkvsh58HkSg= - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.8 - -before_install: -- if echo "$TRAVIS_COMMIT_MESSAGE" | grep -F -q "[skip travis]" ; then echo "[skip - travis] has been found, exiting" && exit 0 ; else echo "[skip travis] has not been - found, continuing" ; fi -- if test "${TRAVIS_COMMIT_MESSAGE#*'[publish binary]'}" != "$TRAVIS_COMMIT_MESSAGE"; then PUBLISH_BINARY=true; fi; -- export PATH=./node_modules/.bin/:$PATH - -install: -- npm install --build-from-source -- npm test - -before_script: -- if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp package publish; fi; -- node-pre-gyp clean - -script: -- 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 -- node-pre-gyp clean - -after_success: -- node-pre-gyp info - -# jobs: -# include: -# - stage: npm release -# node_js: '8' -# script: echo "Deploying to NPM" -# deploy: -# provider: npm -# skip_cleanup: true -# email: dainis@tillers.lv -# api_key: "$NPM_API_KEY" -# on: -# repo: dainis/node-gcstats -# branch: master -# condition: ${TRAVIS_COMMIT_MESSAGE#*'[publish npm]'}" != "$TRAVIS_COMMIT_MESSAGE diff --git a/package.json b/package.json index dad0d00..a375355 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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": {