forked from haroohie-club/SerialLoops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-official.yml
401 lines (380 loc) · 18.4 KB
/
azure-pipelines-official.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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
trigger: none
pr: none
schedules:
- cron: "0 23 * * *"
displayName: Nightly build
branches:
include:
- main
parameters:
- name: version
displayName: Release Version
type: string
default: ''
- name: releaseNotes
displayName: Release Notes
type: string
default: 'Latest nightly build. **Note that this is likely to have bugs and we recommend you use a regular release instead!**'
name: 0.3.pre.$(Rev:r)
variables:
- name: Version
${{ if ne(parameters['version'], '') }}:
value: ${{ parameters.version }}
${{ if eq(parameters['version'], '') }}:
value: $(Build.BuildNumber)
- name: AssemblyVersion
${{ if ne(parameters['version'], '') }}:
value: ${{ parameters.version }}
${{ if eq(parameters['version'], '') }}:
value: ${{ replace(variables['Build.BuildNumber'], 'pre', '9999') }}
stages:
- stage: Build
jobs:
- job:
strategy:
matrix:
Linux:
imageName: 'ubuntu-latest'
artifactName: 'Linux-v$(Version)'
framework: 'net8.0'
rid: 'linux-x64'
artifactFile: 'publish.zip'
Windows:
imageName: 'windows-latest'
artifactName: 'Windows-v$(Version)'
framework: 'net8.0-windows'
rid: 'win-x64'
artifactFile: 'publish.zip'
displayName: Build & Publish
pool:
vmImage: $(imageName)
steps:
- checkout: self
clean: true
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
projects: $(Build.SourcesDirectory)/src/SerialLoops/SerialLoops.csproj
arguments: '-c Release -f $(framework) -r $(rid) --self-contained /p:DebugType=None /p:DebugSymbols=false /p:PublishSingleFile=true'
publishWebProjects: false
env:
SLVersion: $(Version)
SLAssemblyVersion: $(AssemblyVersion)
displayName: Build & Publish Serial Loops
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/src/SerialLoops/bin/Release/$(framework)/$(rid)/$(artifactFile)'
ArtifactName: '$(artifactName)'
publishLocation: 'Container'
displayName: Publish build artifact
- job:
strategy:
matrix:
x64:
artifactName: 'macOS-x64-v$(Version)'
rid: 'osx-x64'
arm64:
artifactName: 'macOS-arm-v$(Version)'
rid: 'osx-arm64'
displayName: Build & Publish macOS
pool:
vmImage: macos-latest
steps:
- checkout: self
clean: true
- task: DotNetCoreCLI@2
inputs:
command: 'custom'
custom: 'restore'
arguments: '$(Build.SourcesDirectory)/src/SerialLoops/SerialLoops.csproj -r $(rid)'
displayName: Restore
- task: DotNetCoreCLI@2
inputs:
command: 'custom'
custom: 'msbuild'
arguments: '$(Build.SourcesDirectory)/src/SerialLoops/SerialLoops.csproj -t:BundleApp -p:Configuration=Release -p:TargetFramework=net8.0 -p:RuntimeIdentifier=$(rid) -p:UseAppHost=true --p:SelfContained=true -p:DebugType=None -p:DebugSymbols=false -p:PublishSingleFile=true'
env:
SLVersion: $(Version)
SLAssemblyVersion: $(AssemblyVersion)
displayName: Build & Publish Serial Loops
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/src/SerialLoops/bin/Release/net8.0/$(rid)/publish/Serial Loops.app'
ArtifactName: '$(artifactName)'
publishLocation: 'Container'
displayName: Publish build artifact
- stage: Package
dependsOn: Build
jobs:
- job:
strategy:
matrix:
macOS-x64:
artifactName: 'macOS-x64-v$(Version)'
macOS-arm64:
artifactName: 'macOS-arm-v$(Version)'
pool:
vmImage: macos-latest
steps:
- checkout: self
clean: true
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: $(artifactName)
downloadPath: '$(Build.ArtifactStagingDirectory)'
displayName: Download macOS zip artifact
- script: python -m pip install macos-pkg-builder
displayName: Install macos-pkg-builder pip package
- script: |
cd install/macos/
mkdir "Serial Loops.app"
cp -r $SLApp/* "./Serial Loops.app/"
chmod +x "./Serial Loops.app/Contents/MacOS/SerialLoops"
python serial_loops_pkg_builder.py $SLVersion
env:
SLVersion: $(Version)
SLApp: "$(Build.ArtifactStagingDirectory)/$(artifactName)"
displayName: Build macOS pkg installer
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/install/macos/SerialLoops.pkg
ArtifactName: $(artifactName)-installer
publishLocation: 'Container'
displayName: Publish macOS pkg installer
displayName: Build macOS pkg installer
- job:
pool:
vmImage: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08
options: --privileged
steps:
- checkout: self
clean: true
- script: |
cp -r install/linux/flatpak/* $(Agent.BuildDirectory)/
cd $(Agent.BuildDirectory)
flatpak-builder build-dir --install-deps-from=flathub --download-only club.haroohie.SerialLoops.yaml
python flatpak-dotnet-generator.py --dotnet 8 --freedesktop 23.08 nuget-sources.json SerialLoops/src/SerialLoops/SerialLoops.csproj
flatpak-builder build-dir --force-clean --install --repo=repo club.haroohie.SerialLoops.yaml
flatpak build-bundle ./repo SerialLoops.flatpak club.haroohie.SerialLoops
displayName: Build flatpak
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Agent.BuildDirectory)/SerialLoops.flatpak'
ArtifactName: 'Linux-v$(Version)-flatpak'
publishLocation: 'Container'
displayName: Publish Linux flatpak
displayName: Build Linux flatpak
- job:
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
clean: true
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Linux-v$(Version)'
downloadPath: '$(Build.ArtifactStagingDirectory)'
displayName: Download Linux zip artifact
- pwsh: |
Copy-Item -Path ./install/linux/dpkg-build -Destination ./dpkg-build -Recurse -Exclude ".gitkeep"
New-Item -ItemType "directory" -Path ./dpkg-build/SerialLoops/usr -Name bin
Push-Location ./dpkg-build/SerialLoops
((Get-Content -Path DEBIAN/control) -replace '#VERSION#', '$(Version)') | Set-Content -Path DEBIAN/control
Expand-Archive $(Build.ArtifactStagingDirectory)/Linux-v$(Version)/publish.zip -DestinationPath $(Build.ArtifactStagingDirectory)/publish/
Copy-Item -Path $(Build.ArtifactStagingDirectory)/publish/* -Destination ./usr/lib/SerialLoops -Recurse
ln -s /usr/lib/SerialLoops/SerialLoops usr/bin/SerialLoops
Set-Location ..
dpkg-deb --build SerialLoops
Pop-Location
displayName: Create deb package
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/dpkg-build/SerialLoops.deb'
ArtifactName: 'Linux-v$(Version)-deb'
publishLocation: 'Container'
displayName: Publish Linux deb
displayName: Build Linux deb package
- job:
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
clean: true
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Linux-v$(Version)'
downloadPath: '$(Build.ArtifactStagingDirectory)'
displayName: Download Linux zip artifact
- pwsh: |
Expand-Archive $(Build.ArtifactStagingDirectory)/Linux-v$(Version)/publish.zip -DestinationPath $(Build.ArtifactStagingDirectory)/publish/
chmod +x $(Build.ArtifactStagingDirectory)/publish/SerialLoops
Push-Location $(Build.ArtifactStagingDirectory)/publish
tar -czvf ../publish.tar.gz --transform 's,^\.\/,SerialLoops-$(Version)/,' .
Pop-Location
displayName: Create tarball
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/publish.tar.gz'
ArtifactName: 'Linux-v$(Version)-tar'
publishLocation: 'Container'
displayName: Publish Linux tarball
- pwsh: |
tar -czvf $(Build.ArtifactStagingDirectory)/source.tar.gz --transform 's,^\.\/,SerialLoops-$(Version)/,' .
((Get-Content -Path ./install/linux/rpm/rpmbuild/SPECS/SerialLoops.spec) -Replace '#VERSION#', '$(Version)') | Set-Content -Path ./install/linux/rpm/rpmbuild/SPECS/SerialLoops.spec
Copy-Item -Path $(Build.ArtifactStagingDirectory)/source.tar.gz -Destination $(Build.SourcesDirectory)/install/linux/rpm/rpmbuild/SOURCES/SerialLoops-$(Version).tar.gz
docker run -v $(Build.SourcesDirectory)/install/linux/rpm/rpm-scripts:/rpm-scripts -v $(Build.SourcesDirectory)/install/linux/rpm/rpmbuild:/root/rpmbuild fedora:39 /rpm-scripts/rpm-make.sh
displayName: Build rpm
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/install/linux/rpm/rpmbuild/RPMS/x86_64/SerialLoops-$(Version)-1.fc39.x86_64.rpm'
ArtifactName: 'Linux-v$(Version)-rpm'
publishLocation: 'Container'
displayName: Publish Linux rpm
displayName: Package Linux tarball & build Linux rpm package
- job:
pool:
vmImage: windows-latest
steps:
- checkout: self
clean: true
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Windows-v$(Version)'
downloadPath: '$(Build.ArtifactStagingDirectory)'
displayName: Download Windows zip artifact
- pwsh: Expand-Archive -Path $(Build.ArtifactStagingDirectory)\Windows-v$(Version)\publish.zip -Destination $(Build.SourcesDirectory)\publish
displayName: Unpack published artifacts
- pwsh: |
((Get-Content -Path $(Build.SourcesDirectory)\install\windows\serial-loops.iss) -replace '#VERSION#', '$(Version)') | Set-Content -Path $(Build.SourcesDirectory)\install\windows\serial-loops.iss
Start-BitsTransfer -Source https://haroohie.nyc3.cdn.digitaloceanspaces.com/bootstrap/serial-loops/iscc.zip -Destination $(Build.SourcesDirectory)\install\windows\iscc.zip
Expand-Archive -Path $(Build.SourcesDirectory)\install\windows\iscc.zip -DestinationPath $(Build.SourcesDirectory)\install\windows\
Start-BitsTransfer -Source https://github.com/devkitPro/installer/releases/download/v3.0.3/devkitProUpdater-3.0.3.exe -Destination $(Build.SourcesDirectory)\install\windows\devkitProUpdater-3.0.3.exe
Start-BitsTransfer -Source https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe -Destination "$(Build.SourcesDirectory)\install\windows\Docker Desktop Installer.exe"
displayName: Download ISCC and Docker Desktop Installer
- pwsh: $(Build.SourcesDirectory)\install\windows\iscc\ISCC.exe .\install\windows\serial-loops.iss
displayName: Compile Windows installer
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/install/windows/Output/SerialLoopsInstaller.exe'
ArtifactName: 'Windows-v$(Version)-installer'
publishLocation: 'Container'
displayName: Publish Windows installer
displayName: Build Windows installer
- stage: Publish
dependsOn: Package
jobs:
- job:
pool:
vmImage: ubuntu-latest
displayName: Create Pre-Release
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Linux tarball
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Linux-v$(Version)-tar'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download Linux flatpak
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Linux-v$(Version)-flatpak'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download Linux deb
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Linux-v$(Version)-deb'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download Linux rpm
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Linux-v$(Version)-rpm'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download macOS x64 installer
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'macOS-x64-v$(Version)-installer'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download macOS ARM installer
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'macOS-arm-v$(Version)-installer'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download Windows zip
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Windows-v$(Version)'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download Windows installer
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Windows-v$(Version)-installer'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- pwsh: |
Move-Item -Path $(Build.ArtifactStagingDirectory)/Linux-v$(Version)-tar/publish.tar.gz -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-linux-x64-v$(Version).tar.gz
Move-Item -Path $(Build.ArtifactStagingDirectory)/Linux-v$(Version)-flatpak/SerialLoops.flatpak -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-linux-x64-v$(Version).flatpak
Move-Item -Path $(Build.ArtifactStagingDirectory)/Linux-v$(Version)-deb/SerialLoops.deb -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-$(Version)_amd64.deb
Move-Item -Path $(Build.ArtifactStagingDirectory)/Linux-v$(Version)-rpm/SerialLoops-$(Version)-1.fc39.x86_64.rpm -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-$(Version)-1.fc39.x86_64.rpm
Move-Item -Path "$(Build.ArtifactStagingDirectory)/macOS-x64-v$(Version)-installer/SerialLoops.pkg" -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-macOS-x64-v$(Version).pkg
Move-Item -Path "$(Build.ArtifactStagingDirectory)/macOS-arm-v$(Version)-installer/SerialLoops.pkg" -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-macOS-arm-v$(Version).pkg
Move-Item -Path $(Build.ArtifactStagingDirectory)/Windows-v$(Version)/publish.zip -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-windows-x64-v$(Version).zip
Move-Item -Path $(Build.ArtifactStagingDirectory)/Windows-v$(Version)-installer/SerialLoopsInstaller.exe -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-windows-x64-v$(Version).exe
displayName: Move and rename artifacts
# - task: GitHubRelease@1
# displayName: 'Create GitHub Pre-Release'
# inputs:
# gitHubConnection: 'GitHub Connection (Jonko)'
# tagSource: userSpecifiedTag
# tag: '$(Version)'
# title: 'Serial Loops v$(Version)'
# releaseNotesSource: inline
# releaseNotesInline: |
# ${{ parameters.releaseNotes }}
# ## Installation Notes
# Please ensure you have installed [devkitARM from devkitPro](https://devkitpro.org/wiki/Getting_Started) before using the program. Select the NDS Development workload when installing to do this.
# Additionally, to test the game you will need to have a Nintendo DS emulator installed. We recommend [melonDS](https://melonds.kuribo64.net/) for its accuracy.
# ### Windows
# Simply download the Windows installer application and run it. It will walk you through installation, including installing the necessary dependencies.
# Alternatively, you can download the zip file for a portable application; however, dependencies are not included with this option.
# Because our application contacts GitHub's servers to check for new releases on launch, it is possible it will get flagged by firewall software – please allow it through so it can function correctly.
# ### macOS
# Pick the macOS pkg installer that fits your computer's architecture. Before executing it, you will need to open the Terminal application and run `xattr -cr /User/yourusernamehere/Downloads/pkginstallernamehere.pkg`,
# replacing "yourusernamehere" with your username and "pkginstallernamehere.pkg" with the appropriate pkg installer filename. Running this command makes it so that the pkg installer is runnable even though we don't codesign it.
# The pkg installer will guide you through installing Serial Loops and will automatically install the dependencies devkitARM and make if necessary.
# #### Which macOS pkg installer should I choose?
# If your Mac is newer, you will probably want the ARM installer. If it is older, you may want the x64 one. If unsure, download the ARM one first and attempt to run it – it will throw an error saying it can't be run on this computer if your computer is not able to run it. If that's the case, download the x64 one instead.
# ### Linux
# We recommend using the provided flatpak as it is the easiest to use. First, install flatpak if you haven't already. Then, download the flatpak and double click it or run `flatpak install` on it from the terminal. It will then install itself,
# bringing all the necessary dependencies with it.
# If you would rather manually install, follow the below instructions:
# * The `.deb` package is intended for Debian-based distros (e.g. Ubuntu). Install it with `sudo apt install -f ./SerialLoops-$(Version)_amd64.deb`.
# * The `.rpm` package is intended for Red Hat distros (e.g. Fedora). Install it with `sudo dnf install ./SerialLoops-$(Version)-1.fc39.x86_64.rpm`.
# * For other Linux distros, please use the binaries packaged in the `.tar.gz` archive; when doing so, ensure you install the OpenAL binaries so audio playback works.
# ${{ if eq(parameters['version'], '') }}:
# isPreRelease: true
# ${{ if ne(parameters['version'], '') }}:
# isPreRelease: false