v0.15.1 #48
Workflow file for this run
This file contains hidden or 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: Prebuild & Publish | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| prebuild: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| arch: x64 | |
| - os: ubuntu-24.04-arm | |
| arch: arm64 | |
| - os: macos-latest | |
| arch: arm64 | |
| - os: windows-latest | |
| arch: x64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install deps (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install re2 abseil mimalloc | |
| - name: Install deps (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libre2-dev libabsl-dev | |
| - name: Setup MSVC | |
| if: runner.os == 'Windows' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: x64 | |
| - name: Setup vcpkg | |
| if: runner.os == 'Windows' | |
| run: | | |
| C:\vcpkg\bootstrap-vcpkg.bat | |
| shell: cmd | |
| - name: Install deps (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| C:\vcpkg\vcpkg install re2:x64-windows-static | |
| C:\vcpkg\vcpkg install abseil:x64-windows-static | |
| shell: cmd | |
| - name: Set Toolchain and Triplet | |
| if: runner.os == 'Windows' | |
| run: | | |
| echo "CMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| echo "VCPKG_TARGET_TRIPLET=x64-windows-static" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Prebuild | |
| run: npm run prebuild | |
| # `strip -Sx` rewrites the Mach-O and invalidates the ad-hoc signature | |
| # the linker applied. arm64 macOS refuses to load unsigned code, so the | |
| # binary must be re-signed and verified before it ships. | |
| - name: Re-sign and verify macOS prebuild | |
| if: runner.os == 'macOS' | |
| run: | | |
| for f in prebuilds/*/node-napi-v10.node; do | |
| codesign --force --sign - "$f" | |
| codesign --verify --verbose "$f" | |
| done | |
| - name: Upload prebuilds | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: prebuild-${{ matrix.os }}-${{ matrix.arch }} | |
| path: prebuilds/ | |
| prebuild-musl: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: x64 | |
| platform: linux/amd64 | |
| - arch: arm64 | |
| platform: linux/arm64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-qemu-action@v3 | |
| if: matrix.arch == 'arm64' | |
| - name: Build in Alpine container | |
| run: | | |
| docker run --rm --platform ${{ matrix.platform }} \ | |
| -v ${{ github.workspace }}:/work -w /work \ | |
| node:22-alpine sh -c " | |
| apk add --no-cache git python3 make g++ cmake re2-dev abseil-cpp-dev linux-headers && | |
| npm install && | |
| npx pkg-prebuilds-copy --baseDir build/Release --source ata.node --name=ata --strip --napi_version=10 --libc=musl | |
| " | |
| - name: Upload prebuilds | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: prebuild-linux-musl-${{ matrix.arch }} | |
| path: prebuilds/ | |
| publish: | |
| needs: [prebuild, prebuild-musl] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: https://registry.npmjs.org | |
| - name: Install dependencies | |
| run: npm install --ignore-scripts | |
| - name: Download all prebuilds | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: prebuilds/ | |
| pattern: prebuild-* | |
| merge-multiple: true | |
| - name: List prebuilds | |
| run: | | |
| echo "=== Prebuild contents ===" | |
| find prebuilds -type f -name "*.node" | |
| echo "=== Total size ===" | |
| du -sh prebuilds/ | |
| - name: Publish to npm | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |