Skip to content

Commit

Permalink
Split windows and macos jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Srikanth Kotagiri committed Jul 8, 2024
1 parent e7e3ed6 commit 1bf57f2
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,35 @@ jobs:
# - name: prebuild for Linux (arm64)
# run: npx prebuild --runtime napi --arch arm64 --include-regex '(\.node|\.dylib|ffmpeg|ffprobe)$' --upload ${{ secrets.GITHUB_TOKEN }}

package:
windows-package:
permissions:
contents: write
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- windows-latest
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Use nodejs
uses: actions/setup-node@v1
with:
node-version: 16.13.0

- name: npm install
run: npm install
env:
PREBUILD: true

- name: install Windows dependencies
run: node ./install_ffmpeg.js

- name: prebuild for Windows
run: npx prebuild --runtime napi --include-regex '.node|.dll|.exe' --verbose --upload ${{ secrets.GITHUB_TOKEN }}
shell: bash

macos-package:
permissions:
contents: write
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -59,9 +78,7 @@ jobs:

- name: install Mac build dependencies (brew)
run: |
brew install nasm pkg-config
python3 -m pip install packaging setuptools
if: ${{ runner.os == 'macOS'}}
brew install nasm pkg-config python-packaging python-setuptools
- name: npm install
run: npm install
Expand All @@ -70,29 +87,15 @@ jobs:

- name: install Mac dependencies (shared release x64)
run: node ./install_ffmpeg.js --arch x64
if: ${{ runner.os == 'macOS'}}

- name: install Mac dependencies (shared release arm64)
run: node ./install_ffmpeg.js --arch arm64
if: ${{ runner.os == 'macOS'}}

- name: install Windows dependencies
run: node ./install_ffmpeg.js
if: ${{ runner.os == 'Windows'}}

- name: prebuild Release for macOS (x64)
run: npx prebuild --runtime napi --arch x64 --include-regex '(\.node|\.dylib|ffmpeg|ffprobe)$' --verbose --upload ${{ secrets.GITHUB_TOKEN }}
if: ${{ runner.os == 'macOS'}}

- name: clean build directory for cross-compiling
run: rm ./build/Release/*.dylib || true
if: ${{ runner.os == 'macOS'}}

- name: prebuild Release for macOS (arm64)
run: npx prebuild --runtime napi --arch arm64 --include-regex '(\.node|\.dylib|ffmpeg|ffprobe)$' --verbose --upload ${{ secrets.GITHUB_TOKEN }}
if: ${{ runner.os == 'macOS'}}

- name: prebuild for Windows
run: npx prebuild --runtime napi --include-regex '.node|.dll|.exe' --verbose --upload ${{ secrets.GITHUB_TOKEN }}
shell: bash
if: ${{ runner.os == 'Windows'}}

0 comments on commit 1bf57f2

Please sign in to comment.