Merge pull request #27 from Fredolx/global-params #136
This file contains 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: Build and Upload | |
on: | |
push: | |
branches: [ "**" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node-version: [18.x] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
if: matrix.os == 'macos-latest' | |
with: | |
python-version: '3.10' | |
- 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.35.1-x86_64.7z" -OutFile .\mpv.7z | |
break | |
} | |
catch { | |
Write-Host "Error occurred: $_. Retrying in $retryDelay seconds..." | |
Start-Sleep -Seconds $retryDelay | |
} | |
} | |
New-Item -Path '.\libs' -ItemType Directory | |
7z e .\mpv.7z -olibs mpv.exe | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install deps linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt install rpm dpkg fakeroot | |
- name: Install yarn | |
run: | | |
npm install yarn -g | |
- name: Build Angular App | |
working-directory: ./ng-open-tv | |
run: | | |
npm install | |
npm run prod | |
- name: Build Electron app | |
working-directory: ./electron-open-tv | |
run: | | |
npm install | |
npm run publish | |
- name: Upload DEB Artifact | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/[email protected] | |
with: | |
name: open-tv-debian-amd64 | |
path: ./electron-open-tv/out/make/deb/x64/*.deb | |
retention-days: 3 | |
- name: Upload RPM Artifact | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/[email protected] | |
with: | |
name: open-tv-redhat-amd64 | |
path: ./electron-open-tv/out/make/rpm/x64/*.rpm | |
retention-days: 3 | |
- name: Upload Squirrel Artifact | |
if: matrix.os == 'windows-latest' | |
uses: actions/[email protected] | |
with: | |
name: open-tv-windows-squirrel-amd64 | |
path: ./electron-open-tv/out/make/squirrel.windows/x64/*.exe | |
retention-days: 3 | |
- name: Upload DMG Artifact | |
if: matrix.os == 'macos-latest' | |
uses: actions/[email protected] | |
with: | |
name: open-tv-macos-amd64 | |
path: ./electron-open-tv/out/make/*.dmg | |
retention-days: 3 | |