-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
131 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: Prebuildify, package, publish | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
release: | ||
types: [ prereleased, released ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
arch: [x64] #, arm, arm64] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
#- uses: docker/setup-qemu-action@v1 | ||
# with: | ||
# image: tonistiigi/binfmt:latest | ||
# platforms: arm,arm64 #all | ||
- run: docker build . -f ./Dockerfile-${{ matrix.arch }} | ||
--tag voltserver/node-bcrypt-builder-${{ matrix.arch }} | ||
- run: docker create --name node-bcryptjs-builder voltserver/node-bcrypt-builder-${{ matrix.arch }} | ||
- run: docker cp "node-bcryptjs-builder:/usr/local/opt/bcrypt-js/prebuilds" . | ||
- run: find prebuilds | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: prebuild-${{ matrix.arch }} | ||
path: ./prebuilds | ||
|
||
pack: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm ci | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
path: /tmp/prebuilds/ | ||
- name: Coalesce prebuilds from build matrix | ||
run: | | ||
mkdir prebuilds | ||
for d in /tmp/prebuilds/*; do | ||
mv $d/* prebuilds/ | ||
done | ||
- run: chmod a+x prebuilds/*/*.node && find prebuilds -executable -type f | ||
- run: echo "PACK_FILE=$(npm pack)" >> $GITHUB_ENV | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: package-tgz | ||
path: ${{ env.PACK_FILE }} | ||
|
||
publish-npm: | ||
needs: pack | ||
if: github.event_name == 'release' && contains('prereleased,released', github.event.action) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
registry-url: 'https://registry.npmjs.org' | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: package-tgz | ||
path: /tmp/package/ | ||
- run: npm publish /tmp/package/voltserver-bcrypt3*.tgz | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | ||
|
||
publish-gpr: | ||
needs: pack | ||
if: github.event_name == 'release' && contains('prereleased,released', github.event.action) | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
registry-url: https://npm.pkg.github.com/ | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: package-tgz | ||
path: /tmp/package/ | ||
- run: npm publish /tmp/package/voltserver-bcrypt*.tgz | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | ||
|
||
name: Test on PR/ Merge | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test-and-build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [14.x, 16.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm i -g prebuildify node-gyp | ||
- run: npm ci | ||
- run: npm test | ||
- run: npm run build |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters