macos buld problems #21
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: | |
| branches: [n_api, master] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [n_api, master] | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| prebuild-node: | |
| name: Prebuild Node ${{ matrix.node }} on ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-2022, macos-latest] | |
| node: [20, 22, 23, 24] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| # Linux specific setup | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| # Add Microsoft repository | |
| curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc | |
| curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list | |
| # Install dependencies | |
| sudo apt-get update | |
| sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 mssql-tools18 unixodbc-dev gcc-10 g++-10 | |
| # Set compiler | |
| echo "CC=gcc-10" >> $GITHUB_ENV | |
| echo "CXX=g++-10" >> $GITHUB_ENV | |
| # Windows specific setup | |
| - name: Install Windows dependencies | |
| if: runner.os == 'Windows' | |
| shell: powershell | |
| run: | | |
| # ODBC Driver 18 for SQL Server should already be installed on Windows runners | |
| # Just verify it exists | |
| Get-OdbcDriver -Name "*SQL Server*" | |
| # macOS specific setup | |
| - name: Install macOS dependencies | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install unixodbc | |
| # Download and install ODBC Driver | |
| brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release | |
| brew update | |
| HOMEBREW_ACCEPT_EULA=Y brew install msodbcsql18 mssql-tools18 | |
| - name: Install npm dependencies | |
| run: npm install | |
| - name: Prebuild binaries | |
| run: npx prebuild --strip | |
| - name: List generated prebuilds | |
| run: | | |
| echo "=== Generated prebuilds ===" | |
| find prebuilds -type f -name "*.tar.gz" 2>/dev/null || echo "No tar.gz files found" | |
| ls -la prebuilds/ || echo "prebuilds directory not found" | |
| - name: Upload to GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: npx prebuild --upload-all | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: prebuilds-node-${{ matrix.node }}-${{ matrix.os }} | |
| path: prebuilds/ | |
| prebuild-electron: | |
| name: Prebuild Electron ${{ matrix.electron }} on ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-20.04, windows-2022, macos-latest] | |
| electron: [32, 33, 34, 35, 36] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 # Use a stable Node version for Electron builds | |
| # Linux specific setup (same as above) | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc | |
| curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list | |
| sudo apt-get update | |
| sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 mssql-tools18 unixodbc-dev gcc-10 g++-10 | |
| echo "CC=gcc-10" >> $GITHUB_ENV | |
| echo "CXX=g++-10" >> $GITHUB_ENV | |
| - name: Install Windows dependencies | |
| if: runner.os == 'Windows' | |
| shell: powershell | |
| run: | | |
| Get-OdbcDriver -Name "*SQL Server*" | |
| - name: Install macOS dependencies | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install unixodbc | |
| brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release | |
| brew update | |
| HOMEBREW_ACCEPT_EULA=Y brew install msodbcsql18 mssql-tools18 | |
| - name: Install npm dependencies | |
| run: npm install | |
| - name: Prebuild Electron binaries | |
| run: npx prebuild -r electron -t ${{ matrix.electron }}.0.0 --strip | |
| - name: List generated Electron prebuilds | |
| run: | | |
| echo "=== Generated Electron prebuilds ===" | |
| find prebuilds -type f -name "*.tar.gz" 2>/dev/null || echo "No tar.gz files found" | |
| ls -la prebuilds/ || echo "prebuilds directory not found" | |
| - name: Upload to GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: npx prebuild -r electron --upload-all | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: prebuilds-electron-${{ matrix.electron }}-${{ matrix.os }} | |
| path: prebuilds/ | |
| test-prebuilds: | |
| name: Test prebuilds | |
| needs: [prebuild-node, prebuild-electron] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: prebuilds-artifacts/ | |
| - name: List all prebuilds | |
| run: | | |
| echo "=== All prebuild artifacts ===" | |
| find prebuilds-artifacts -name "*.node" -o -name "*.tar.gz" | sort | |
| - name: Count prebuilds | |
| run: | | |
| TOTAL=$(find prebuilds-artifacts -name "*.node" -o -name "*.tar.gz" | wc -l) | |
| echo "Total prebuilds created: $TOTAL" |