Prepare for v6 #34
Workflow file for this run
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
name: Prebuildify, package, publish | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
release: | |
types: [ prereleased, released ] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
container: | |
- almalinux-devtoolset11 | |
- alpine | |
- linux-armv7 | |
- linux-armv7l-musl | |
- linux-arm64-lts | |
- linux-arm64-musl | |
container: ghcr.io/prebuild/${{ matrix.container }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
npm ci | |
npx prebuildify --napi --tag-libc --strip | |
- run: find prebuilds | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: prebuild-${{ matrix.container }} | |
path: ./prebuilds/ | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- run: npx prebuildify --napi --strip --arch=x86 | |
- run: npx prebuildify --napi --strip --arch=x64 | |
- run: dir prebuilds | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: prebuild-windows | |
path: ./prebuilds/ | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- run: npx prebuildify --napi --strip --arch=arm64 | |
- run: npx prebuildify --napi --strip --arch=x64 | |
- run: find prebuilds | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: prebuild-macos | |
path: ./prebuilds/ | |
pack: | |
needs: | |
- build-linux | |
- build-windows | |
- build-macos | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- uses: actions/download-artifact@v4 | |
with: | |
path: /tmp/prebuilds/ | |
- name: Coalesce prebuilds from build matrix | |
run: | | |
mkdir prebuilds | |
for d in /tmp/prebuilds/*; do | |
cp -Rav $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@v4 | |
with: | |
name: package-tgz | |
path: ${{ env.PACK_FILE }} | |
publish-npm: | |
needs: pack | |
if: github.event_name == 'release' | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/download-artifact@v4 | |
with: | |
name: package-tgz | |
path: /tmp/package/ | |
- run: npm publish /tmp/package/bcrypt*.tgz | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
publish-gpr: | |
needs: pack | |
if: github.event_name == 'release' | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://npm.pkg.github.com/ | |
- uses: actions/download-artifact@v4 | |
with: | |
name: package-tgz | |
path: /tmp/package/ | |
- run: npm publish /tmp/package/bcrypt*.tgz | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |