-
Notifications
You must be signed in to change notification settings - Fork 74
287 lines (234 loc) · 9.86 KB
/
build-release.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
name: Build Release (Stable)
on:
release:
types:
- released
jobs:
cli-framework-stable:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '8.x' ]
name: Build CLI — Framework dependent (Stable)
steps:
- name: Checkout master
uses: actions/checkout@master
with:
ref: "${{ github.ref }}"
submodules: recursive
fetch-depth: 0 # This is set to download the full git history for the repo
- name: Replace Sentry DSN and other keys
shell: pwsh
run: |
./.github/workflows/ReplaceSentryDSN.ps1 -dsn ${{ secrets.SENTRY_DSN }}
./.github/workflows/ReplaceTmdbApiKey.ps1 -apiKey ${{ secrets.TMDB_API }}
./.github/workflows/ReplaceAVD3URL.ps1 -url ${{ secrets.AVD3_URL }}
- name: Get release version
id: release_info
uses: revam/gh-action-get-tag-and-version@v1
with:
tag: "${{ github.ref }}"
prefix: v
prefixRegex: "[vV]?"
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- run: dotnet publish -c Release --no-self-contained Shoko.CLI /p:Version="${{ steps.release_info.outputs.version }}" /p:InformationalVersion="\"channel=stable,commit=${{ github.sha }},tag=${{ steps.release_info.outputs.tag }},date=${{ steps.release_info.outputs.date }},\""
- name: Archive Release
shell: pwsh
run: Compress-Archive .\\Shoko.Server\\bin\\Release\\net8.0\\publish .\\Shoko.CLI_Framework_any-x64.zip
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Shoko.CLI*.zip
tag: ${{ steps.release_info.outputs.tag }}
file_glob: true
cli-standalone-stable:
runs-on: ubuntu-latest
strategy:
matrix:
rid: ['win-x64', 'linux-x64', 'linux-arm64']
dotnet: [ '8.x' ]
name: Build CLI — Standalone ${{ matrix.rid }} (Stable)
steps:
- name: Checkout master
uses: actions/checkout@master
with:
ref: "${{ github.ref }}"
submodules: recursive
fetch-depth: 0 # This is set to download the full git history for the repo
- name: Replace Sentry DSN and other keys
shell: pwsh
run: |
./.github/workflows/ReplaceSentryDSN.ps1 -dsn ${{ secrets.SENTRY_DSN }}
./.github/workflows/ReplaceTmdbApiKey.ps1 -apiKey ${{ secrets.TMDB_API }}
./.github/workflows/ReplaceAVD3URL.ps1 -url ${{ secrets.AVD3_URL }}
- name: Get release version
id: release_info
uses: revam/gh-action-get-tag-and-version@v1
with:
tag: "${{ github.ref }}"
prefix: v
prefixRegex: "[vV]?"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
if: ${{ matrix.rid == 'linux-arm64' }}
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- run: dotnet publish -c Release -r ${{ matrix.rid }} Shoko.CLI /p:Version="${{ steps.release_info.outputs.version }}" /p:InformationalVersion="\"channel=stable,commit=${{ github.sha }},tag=${{ steps.release_info.outputs.tag }},date=${{ steps.release_info.outputs.date }},\""
- name: Archive Release (${{ matrix.rid }})
shell: pwsh
run: Compress-Archive .\\Shoko.Server\\bin\\Release\\net8.0\\${{ matrix.rid }}\\publish .\\Shoko.CLI_Standalone_${{ matrix.rid }}.zip
- name: Upload Release (${{ matrix.rid }})
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Shoko.CLI*.zip
tag: ${{ steps.release_info.outputs.tag }}
file_glob: true
- name: Upload Artifact to shokoanime.com
if: ${{ matrix.rid != 'win-x64' }}
shell: pwsh
env:
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
FTP_SERVER: ${{ secrets.FTP_SERVER }}
run:
.\\.github\\workflows\\UploadRelease.ps1 -remote "ShokoServer-${{ steps.release_info.outputs.version_short }}-${{ matrix.rid }}.zip" -local "Shoko.CLI_Standalone_${{ matrix.rid }}.zip";
tray-service-framework-stable:
runs-on: windows-2022
strategy:
matrix:
dotnet: [ '8.x' ]
name: Build Tray Service — Framework dependent (Stable)
steps:
- name: Checkout master
uses: actions/checkout@master
with:
ref: "${{ github.ref }}"
submodules: recursive
fetch-depth: 0 # This is set to download the full git history for the repo
- name: Replace Sentry DSN and other keys
shell: pwsh
run: |
.\\.github\\workflows\\ReplaceSentryDSN.ps1 -dsn ${{ secrets.SENTRY_DSN }}
.\\.github\\workflows\\ReplaceTmdbApiKey.ps1 -apiKey ${{ secrets.TMDB_API }}
.\\.github\\workflows\\ReplaceAVD3URL.ps1 -url ${{ secrets.AVD3_URL }}
- name: Get release version
id: release_info
uses: revam/gh-action-get-tag-and-version@v1
with:
tag: "${{ github.ref }}"
prefix: v
prefixRegex: "[vV]?"
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- run: dotnet publish -c Release -r win-x64 --no-self-contained Shoko.TrayService /p:Version="${{ steps.release_info.outputs.version }}" /p:InformationalVersion="channel=stable%2ccommit=${{ github.sha }}%2ctag=${{ steps.release_info.outputs.tag }}%2cdate=${{ steps.release_info.outputs.date }}%2c" # %2c is comma, blame windows/pwsh
- name: Archive Release
shell: pwsh
run: Compress-Archive .\\Shoko.Server\\bin\\Release\\net8.0-windows\\win-x64\\publish .\\Shoko.TrayService_Framework_win-x64.zip
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Shoko.TrayService*.zip
tag: ${{ steps.release_info.outputs.tag }}
file_glob: true
tray-service-standalone-stable:
runs-on: windows-2022
strategy:
matrix:
dotnet: [ '8.x' ]
name: Build Tray Service — Standalone (Stable)
steps:
- name: Checkout master
uses: actions/checkout@master
with:
ref: "${{ github.ref }}"
submodules: recursive
fetch-depth: 0 # This is set to download the full git history for the repo
- name: Replace Sentry DSN and other keys
shell: pwsh
run: |
.\\.github\\workflows\\ReplaceSentryDSN.ps1 -dsn ${{ secrets.SENTRY_DSN }}
.\\.github\\workflows\\ReplaceTmdbApiKey.ps1 -apiKey ${{ secrets.TMDB_API }}
.\\.github\\workflows\\ReplaceAVD3URL.ps1 -url ${{ secrets.AVD3_URL }}
- name: Get release version
id: release_info
uses: revam/gh-action-get-tag-and-version@v1
with:
tag: "${{ github.ref }}"
prefix: v
prefixRegex: "[vV]?"
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- run: dotnet publish -c Release -r win-x64 --self-contained true Shoko.TrayService /p:Version="${{ steps.release_info.outputs.version }}" /p:InformationalVersion="channel=stable%2ccommit=${{ github.sha }}%2ctag=${{ steps.release_info.outputs.tag }}%2cdate=${{ steps.release_info.outputs.date }}%2c" # %2c is comma, blame windows/pwsh
- name: Archive Release
shell: pwsh
run: Compress-Archive .\\Shoko.Server\\bin\\Release\\net8.0-windows\\win-x64\\publish .\\Shoko.TrayService_Standalone_win-x64.zip
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Shoko.TrayService*.zip
tag: ${{ steps.release_info.outputs.tag }}
file_glob: true
- name: Build Installer
run: iscc /O".\\" ".\\Installer\\ShokoServer.iss"
- name: Upload Installer to GitHub
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Shoko.Setup.exe
tag: ${{ steps.release_info.outputs.tag }}
file_glob: true
- name: Upload Installer to shokoanime.com
shell: pwsh
env:
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
FTP_SERVER: ${{ secrets.FTP_SERVER }}
run:
.\\.github\\workflows\\UploadRelease.ps1 -remote "ShokoServer-${{ steps.release_info.outputs.version_short }}-Win.exe" -local "Shoko.Setup.exe";
sentry-upload:
runs-on: ubuntu-latest
needs:
- cli-framework-stable
- cli-standalone-stable
- tray-service-framework-stable
- tray-service-standalone-stable
name: Upload version info to Sentry.io
steps:
- name: Checkout master
uses: actions/checkout@master
with:
ref: "${{ github.ref }}"
submodules: recursive
fetch-depth: 0 # This is set to download the full git history for the repo
- name: Get release version
id: release_info
uses: revam/gh-action-get-tag-and-version@v1
with:
tag: "${{ github.ref }}"
prefix: v
prefixRegex: "[vV]?"
- name: Push Sentry release "${{ steps.release_info.outputs.version }}"
uses: getsentry/[email protected]
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
# SENTRY_URL: https://sentry.io/
with:
environment: 'stable'
version: ${{ steps.release_info.outputs.version }}