Macos support #1
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: CI & Prebuilds | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| prebuild: | |
| name: Prebuild on ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo dpkg --add-architecture i386 | |
| sudo apt-get update -y -qq | |
| sudo apt-get install -y g++-multilib gcc-multilib libcups2-dev libcups2-dev:i386 libc6-dev-i386 linux-libc-dev linux-libc-dev:i386 | |
| - name: Set up QEMU for ARM builds | |
| if: runner.os == 'Linux' | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: arm,arm64 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build for Linux | |
| if: runner.os == 'Linux' | |
| run: | | |
| npm run prebuild -- --strip --all --arch ia32 | |
| npm run prebuild -- --strip --all --arch x64 | |
| npm run prebuild -- --strip --all --arch arm | |
| npm run prebuild -- --strip --all --arch arm64 | |
| - name: Build for macOS | |
| if: runner.os == 'macOS' | |
| run: | | |
| npm run prebuild -- --strip --all --arch x64 | |
| npm run prebuild -- --strip --all --arch arm64 | |
| - name: Build for Windows | |
| if: runner.os == 'Windows' | |
| run: | | |
| npm run prebuild -- --strip --all --arch ia32 | |
| npm run prebuild -- --strip --all --arch x64 | |
| npm run prebuild -- --strip --all --arch arm64 | |
| - name: Upload prebuilds artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: prebuilds-${{ matrix.os }} | |
| path: prebuilds/ | |
| publish: | |
| name: Publish Prebuilds | |
| needs: prebuild | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: prebuilds/ | |
| pattern: prebuilds-* | |
| merge-multiple: true | |
| - name: Publish to GitHub Releases | |
| env: | |
| NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.PREBUILD_TOKEN }} | |
| run: npm run release |