-
-
Notifications
You must be signed in to change notification settings - Fork 29
164 lines (144 loc) · 4.55 KB
/
buildAndUpload.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
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, macos-13]
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: startsWith(matrix.os, 'macos-')
run: |
CI=true npm run tauri build
- name: Build
run: |
npm run tauri build
- name: Install tree
if: startsWith(matrix.os, 'macos-')
run: |
brew install tree
- name: View files
shell: powershell
if: matrix.os == 'windows-latest'
run: |
cd src-tauri/target/release/bundle
tree /F
- name: View files
if: matrix.os != 'windows-latest'
run: |
cd src-tauri/target/release/bundle
tree
- name: Upload MSI
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: open-tv-windows
path: src-tauri/target/release/bundle/msi/*.msi
retention-days: 60
- name: Upload DEB
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: open-tv-debian
path: src-tauri/target/release/bundle/deb/*.deb
retention-days: 60
- name: Upload RPM
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: open-tv-redhat
path: src-tauri/target/release/bundle/rpm/*.rpm
retention-days: 60
- name: Upload DMG ARM64
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: open-tv-mac-arm64
path: src-tauri/target/release/bundle/dmg/*.dmg
retention-days: 60
- name: Upload DMG AMD64
if: matrix.os == 'macos-13'
uses: actions/upload-artifact@v4
with:
name: open-tv-mac-AMD64
path: src-tauri/target/release/bundle/dmg/*.dmg
retention-days: 60