v0.4.0: Add async worker threads, native codec probing, and Bun support #1
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 Binaries | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| prebuild: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # macOS | |
| - os: macos-13 # Intel | |
| arch: x64 | |
| - os: macos-14 # Apple Silicon | |
| arch: arm64 | |
| # Linux | |
| - os: ubuntu-22.04 | |
| arch: x64 | |
| # Note: Linux arm64 would need self-hosted runner or QEMU | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install FFmpeg (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libavcodec-dev \ | |
| libavutil-dev \ | |
| libswscale-dev \ | |
| libswresample-dev \ | |
| pkg-config | |
| - name: Install FFmpeg (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install ffmpeg pkg-config | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build TypeScript | |
| run: npm run build:ts | |
| - name: Prebuild native module | |
| run: npm run prebuild | |
| - name: Upload prebuilds | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: prebuild-${{ matrix.os }}-${{ matrix.arch }} | |
| path: prebuilds/ | |
| retention-days: 30 | |
| publish: | |
| needs: prebuild | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| # Required for npm OIDC trusted publishing | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Download all prebuilds | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: prebuilds-all | |
| pattern: prebuild-* | |
| merge-multiple: true | |
| - name: Organize prebuilds | |
| run: | | |
| mkdir -p prebuilds | |
| cp -r prebuilds-all/* prebuilds/ || true | |
| ls -la prebuilds/ | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build TypeScript | |
| run: npm run build:ts | |
| - name: Publish to npm with provenance | |
| run: npm publish --access public --provenance | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |