-
Notifications
You must be signed in to change notification settings - Fork 52
196 lines (166 loc) · 7.61 KB
/
nightly-build.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: Nightly Build
on:
push:
branches: master
paths:
- 'app/build.gradle'
workflow_dispatch:
jobs:
release_desktop:
strategy:
matrix:
platform: [ windows-latest, ubuntu-latest]
# platform: [ windows-latest, ubuntu-latest, macos-latest, macos-13]
runs-on: ${{ matrix.platform }}
if: startsWith(github.event.head_commit.message, 'Release:')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Node.js setup
uses: actions/setup-node@v4
with:
node-version: latest
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- name: Initialize cache
uses: actions/cache@v4
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install app dependencies
run: npm install
# - name: Build app (MacOS - arm64)
# if: matrix.platform == 'macos-latest'
# run: npm run build-mac
# - name: Upload build (MacOS - arm64)
# uses: actions/upload-artifact@v4
# if: matrix.platform == 'macos-latest'
# with:
# name: animetv-mac-arm64.dmg
# path: ./electron/builds/animetv-darwin-arm64/*.dmg
# - name: Build app (MacOS - x64)
# if: matrix.platform == 'macos-13'
# run: npm run build-mac-x64
# - name: Upload build (MacOS - x64)
# uses: actions/upload-artifact@v4
# if: matrix.platform == 'macos-13'
# with:
# name: animetv-mac-x64.dmg
# path: ./electron/builds/animetv-darwin-x64/*.dmg
- name: Build app (Windows - x64)
if: matrix.platform == 'windows-latest'
run: npm run build-win
- name: Upload build windows installer (Windows - x64)
uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: animetv-win32-x64.exe
path: ./electron/builds/*.exe
- name: Upload build windows portable (Windows - x64)
uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: animetv-win32-x64-portable
path: ./electron/builds/AnimeTV-win32-x64
- name: Upload build windows portable (Windows - arm64)
uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: animetv-win32-arm64-portable
path: ./electron/builds/AnimeTV-win32-arm64
- name: Upload build windows update app.asar (Windows - x64)
uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: animetv-win32-x64-update.asar
path: ./electron/builds/AnimeTV-win32-x64/resources
- name: Build app (Linux - x64 & arm64)
if: matrix.platform == 'ubuntu-latest'
run: npm run build-linux && npm run build-linux-arm64
- name: Upload build deb (Linux - x64)
uses: actions/upload-artifact@v4
if: matrix.platform == 'ubuntu-latest'
with:
name: animetv-linux-x64.deb
path: ./electron/builds/*_amd64.deb
- name: Upload build rpm (Linux - x64)
uses: actions/upload-artifact@v4
if: matrix.platform == 'ubuntu-latest'
with:
name: animetv-linux-x64.rpm
path: ./electron/builds/*.x86_64.rpm
- name: Upload build linux portable (Linux - x64)
uses: actions/upload-artifact@v4
if: matrix.platform == 'ubuntu-latest'
with:
name: animetv-linux-x64-portable
path: ./electron/builds/animetv-linux-x64
- name: Upload build linux update app.asar (Linux - x64)
uses: actions/upload-artifact@v4
if: matrix.platform == 'ubuntu-latest'
with:
name: animetv-linux-x64-update.asar
path: ./electron/builds/animetv-linux-x64/resources
- name: Upload build deb (Linux - arm64)
uses: actions/upload-artifact@v4
if: matrix.platform == 'ubuntu-latest'
with:
name: animetv-linux-arm64.deb
path: ./electron/builds/*_aarch64.deb
- name: Upload build rpm (Linux - arm64)
uses: actions/upload-artifact@v4
if: matrix.platform == 'ubuntu-latest'
with:
name: animetv-linux-arm64.rpm
path: ./electron/builds/*.aarch64.rpm
- name: Upload build linux portable (Linux - arm64)
uses: actions/upload-artifact@v4
if: matrix.platform == 'ubuntu-latest'
with:
name: animetv-linux-arm64-portable
path: ./electron/builds/animetv-linux-arm64
- name: Upload build linux update app.asar (Linux - arm64)
uses: actions/upload-artifact@v4
if: matrix.platform == 'ubuntu-latest'
with:
name: animetv-linux-arm64-update.asar
path: ./electron/builds/animetv-linux-arm64/resources
release_mobile:
runs-on: ubuntu-latest
if: startsWith(github.event.head_commit.message, 'Release:')
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Prepare Gradle
run: |
echo "${{ secrets.RELEASE_KEYSTORE }}" > release.keystore.asc
gpg -d --passphrase "${{ secrets.RELEASE_PASSWORD }}" --batch release.keystore.asc > keystore/debug.keystore
chmod +x ./gradlew
- name: Build Apk
run: ./gradlew assembleRelease
- name: Upload build (Android)
uses: actions/upload-artifact@v4
with:
name: animetv-android.apk
path: ./app/build/outputs/apk/release/*.apk
- name: Draft release
uses: marvinpinto/action-automatic-releases@latest
if: startsWith(github.event.head_commit.message, 'Release:v')
with:
repo_token: "${{ secrets.RELEASE_TOKEN }}"
automatic_release_tag: "latest"
draft: true
title: "Dev Release ${{ env.date_now }}"
files: ./app/build/outputs/apk/release/*.apk