Skip to content

add ci for macOS

add ci for macOS #213

name: Build and Upload
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Download mpv
if: matrix.os == 'windows-latest'
shell: powershell
run: |
$retryCount = 3
$retryDelay = 5
for ($i = 1; $i -le $retryCount; $i++) {
try {
Invoke-WebRequest -UserAgent "Wget" -Uri "https://downloads.sourceforge.net/project/mpv-player-windows/release/mpv-0.39.0-x86_64.7z" -OutFile .\mpv.7z
break
}
catch {
Write-Host "Error occurred: $_. Retrying in $retryDelay seconds..."
Start-Sleep -Seconds $retryDelay
}
}
New-Item -Path 'C:\open-tv-deps' -ItemType Directory
7z e .\mpv.7z -oC:\open-tv-deps mpv.exe
- name: Download ffmpeg
if: matrix.os == 'windows-latest'
shell: powershell
run: |
$retryCount = 3
$retryDelay = 5
for ($i = 1; $i -le $retryCount; $i++) {
try {
Invoke-WebRequest -UserAgent "Wget" -Uri "https://github.com/BtbN/FFmpeg-Builds/releases/latest/download/ffmpeg-master-latest-win64-gpl.zip" -OutFile .\ffmpeg.zip
break
}
catch {
Write-Host "Error occurred: $_. Retrying in $retryDelay seconds..."
Start-Sleep -Seconds $retryDelay
}
}
7z e .\ffmpeg.zip -oC:\open-tv-deps ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe
- name: Download yt-dlp
if: matrix.os == 'windows-latest'
shell: powershell
run: |
$retryCount = 3
$retryDelay = 5
for ($i = 1; $i -le $retryCount; $i++) {
try {
Invoke-WebRequest -UserAgent "Wget" -Uri "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe" -OutFile yt-dlp.exe
break
}
catch {
Write-Host "Error occurred: $_. Retrying in $retryDelay seconds..."
Start-Sleep -Seconds $retryDelay
}
}
Move-Item -Path yt-dlp.exe -Destination C:\open-tv-deps
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install deps linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- name: Install deps project
run: |
npm install
- name: Build
if: matrix.os == 'macos'
run: |
CI=true npm run tauri build
- name: Build
if: matrix.os != 'macos'
run: |
npm run tauri build