name: release on: workflow_dispatch: release: types: [published] jobs: build: strategy: fail-fast: false matrix: include: - os: windows-latest arch: x64 node: 24 - os: windows-latest arch: arm64 node: 24 - os: macos-latest arch: x64 node: 18 - os: macos-latest arch: arm64 node: 18 - os: ubuntu-latest arch: x64 libc: glibc image: ghcr.io/prebuild/almalinux-devtoolset11:2.3.1 node: 18 - os: ubuntu-latest arch: x64 libc: musl image: ghcr.io/prebuild/alpine:2.1.1 node: 18 - os: ubuntu-latest arch: arm64 libc: glibc image: ghcr.io/prebuild/linux-arm64-lts:2.1.1 node: 18 - os: ubuntu-latest arch: arm64 libc: musl image: ghcr.io/prebuild/linux-arm64-musl:2.1.1 node: 18 - os: ubuntu-latest arch: arm libc: glibc image: ghcr.io/prebuild/linux-armv7:2.1.1 node: 18 - os: ubuntu-latest arch: arm libc: musl image: ghcr.io/prebuild/linux-armv7l-musl:2.3.1 node: 18 - os: ubuntu-latest arch: arm64 image: ghcr.io/prebuild/android-arm64:2.1.1 node: 18 runs-on: ${{matrix.os}} container: image: ${{matrix.image}} options: -u root steps: - run: microdnf install git tar -y if: ${{ matrix.arch == 'x64' && matrix.libc == 'glibc' }} - uses: actions/checkout@v6 - run: corepack enable - uses: actions/setup-node@v6 with: cache: yarn node-version: ${{matrix.node}} - run: yarn --frozen-lockfile --ignore-scripts - run: yarn prebuild --arch ${{ matrix.arch }} -t ${{ matrix.node }}.0.0 env: PREBUILD_LIBC: ${{ matrix.libc }} - name: Upload artifacts uses: actions/upload-artifact@v6 with: name: prebuilds-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.libc || 'none' }}-node${{ matrix.node }} path: prebuilds build-freebsd: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Build FreeBSD uses: vmactions/freebsd-vm@v1 with: usesh: true prepare: | pkg install -y -f curl node libnghttp2 npm yarn python3 echo "~~~~ node -v ~~~~" node -v echo "~~~~ yarn --version ~~~~" yarn --version run: | yarn --frozen-lockfile --ignore-scripts yarn prebuild --arch x64 -t 18.0.0 - name: Upload artifacts uses: actions/upload-artifact@v6 with: name: prebuilds-freebsd-x64-node18 path: prebuilds build-wasm: runs-on: ubuntu-latest container: image: emscripten/emsdk:6.0.1 steps: - uses: actions/checkout@v6 - run: corepack enable - uses: actions/setup-node@v6 with: cache: yarn node-version: 18 - run: yarn --frozen-lockfile - run: make wasm - name: Upload artifacts uses: actions/upload-artifact@v6 with: name: wasm path: build/Release/watcher.wasm release: runs-on: ubuntu-latest needs: - build - build-freebsd - build-wasm steps: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: cache: yarn node-version: 18 - run: yarn --frozen-lockfile --ignore-scripts - name: Merge prebuild artifacts uses: actions/upload-artifact/merge@v6 with: name: prebuilds pattern: prebuilds-* delete-merged: true - name: Download artifacts uses: actions/download-artifact@v6 - name: Build npm packages run: | node scripts/build-npm.js node scripts/build-wasm.js - name: Publish to npm env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > ~/.npmrc for pkg in npm/*; do echo "Publishing $pkg..." cd $pkg; npm publish; cd ../..; done