-
Notifications
You must be signed in to change notification settings - Fork 6
/
azure-pipelines-official.yml
265 lines (247 loc) · 14.6 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
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'
platformName: 'Gtk'
artifactName: 'Linux-v$(Version)'
framework: 'net8.0'
rid: 'linux-x64'
artifactPath: '$(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Gtk/Release/net8.0/linux-x64/publish.tar.gz'
secondArtifactPath: '$(Build.SourcesDirectory)/dpkg-build/SerialLoops.deb'
thirdArtifactPath: '$(Build.SourcesDirectory)/rpmbuild/RPMS/x86_64/SerialLoops-$(Version)-1.fc39.x86_64.rpm'
extraPublishParams: ''
macOS-x64:
imageName: 'macOS-latest'
platformName: 'Mac'
artifactName: 'macOS-x64-v$(Version)'
framework: 'net8.0'
rid: 'osx-x64'
artifactPath: '$(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Mac/Release/net8.0/osx-x64/Serial Loops.dmg'
secondArtifactPath: ''
thirdArtifactPath: ''
extraPublishParams: '/p:EnableDmgBuild=true'
macOS-arm64:
imageName: 'macOS-latest'
platformName: 'Mac'
artifactName: 'macOS-arm-v$(Version)'
framework: 'net8.0'
rid: 'osx-arm64'
artifactPath: '$(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Mac/Release/net8.0/osx-arm64/Serial Loops.dmg'
secondArtifactPath: ''
thirdArtifactPath: ''
extraPublishParams: '/p:EnableDmgBuild=true'
Windows:
imageName: 'windows-latest'
platformName: 'Wpf'
artifactName: 'Windows-v$(Version)'
framework: 'net8.0-windows'
rid: 'win-x64'
artifactPath: '$(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Wpf/Release/net8.0-windows/win-x64/publish.zip'
secondArtifactPath: ''
thirdArtifactPath: ''
extraPublishParams: ''
displayName: Build & Publish
pool:
vmImage: $(imageName)
steps:
- checkout: self
clean: true
- pwsh: |
Push-Location ..
Move-Item s SerialLoops-$(Version)
tar -czvf SerialLoops-$(Version).tar.gz SerialLoops-$(Version)
Move-Item SerialLoops-$(Version) s
Pop-Location
displayName: Create source tar.gz for rpm package
condition: eq(variables['rid'], 'linux-x64')
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
projects: $(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/SerialLoops.$(platformName).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
- pwsh: |
Expand-Archive $(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Gtk/Release/net8.0/linux-x64/publish.zip -DestinationPath $(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Gtk/Release/net8.0/linux-x64/publish/
chmod +x $(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Gtk/Release/net8.0/linux-x64/publish/SerialLoops
Push-Location $(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Gtk/Release/net8.0/linux-x64/publish
tar -czvf ../publish.tar.gz --transform 's,^\.\/,,' .
Pop-Location
mkdir -p dpkg-build/SerialLoops/DEBIAN
mkdir -p dpkg-build/SerialLoops/usr/bin
mkdir -p dpkg-build/SerialLoops/usr/lib/SerialLoops
mkdir -p dpkg-build/SerialLoops/usr/share/applications
Push-Location dpkg-build/SerialLoops
Write-Output "Package: SerialLoops`nVersion: $(Version)`nSection: custom`nPriority: optional`nArchitecture: all`nEssential: no`nDepends: libopenal-dev, make`nMaintainer: The Haroohie Translation Club <[email protected]>`nHomepage: https://haroohie.club/`nDescription: Editor for Suzumiya Haruhi no Chokuretsu`n" | Out-File -FilePath DEBIAN/control
Write-Output "[Desktop Entry]`nVersion=$(Version)`nName=Serial Loops`nComment=Editor for Suzumiya Haruhi no Chokuretsu`nExec=/usr/bin/SerialLoops`nIcon=/usr/lib/SerialLoops/Icons/AppIcon.png`nTerminal=false`nType=Application`nCategories=Utility;Application;`n" | Out-File -FilePath usr/share/applications/SerialLoops.desktop
chmod 777 usr/lib/SerialLoops
chmod +x usr/share/applications/SerialLoops.desktop
mv $(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/bin/Gtk/Release/net8.0/linux-x64/publish/* usr/lib/SerialLoops
ln -s /usr/lib/SerialLoops/SerialLoops usr/bin/SerialLoops
cd ..
dpkg-deb --build SerialLoops
Pop-Location
mkdir -p rpmbuild/BUILD
mkdir -p rpmbuild/RPMS
mkdir -p rpmbuild/SOURCES
mkdir -p rpmbuild/SPECS
mkdir -p rpmbuild/SRPMS
mv $(Build.SourcesDirectory)/../SerialLoops-$(Version).tar.gz $(Build.SourcesDirectory)/rpmbuild/SOURCES/
Write-Output "Name: SerialLoops`nVersion: $(Version)`nRelease: 1%{?dist}`nSummary: Editor for Suzumiya Haruhi no Chokuretsu`nExclusiveArch: x86_64`n`nLicense: GPLv3`nURL: https://haroohie.club/chokuretsu/serial-loops`nSource0: %{name}-%{version}.tar.gz`nSource1: https://github.com/haroohie-club/SerialLoops`n`nBuildRequires: dotnet-sdk-8.0`nRequires: openal-soft make`n`n%global debug_package %{nil}`n%define __os_install_post %{nil}`n`n%description`nAn editor for the Nintendo DS game Suzumiya Haruhi no Chokuretsu (The Series of Haruhi Suzumiya)`n`n%prep`n%setup -q`n`n%build`ndotnet publish src/SerialLoops.Gtk/SerialLoops.Gtk.csproj -c Release -f net8.0 -r linux-x64 --self-contained /p:DebugType=None /p:DebugSymbols=false /p:PublishSingleFile=true`n`n%install`nrm -rf %{buildroot}`nmkdir -p %{buildroot}/%{_bindir}`nmkdir -p %{buildroot}/%{_libdir}/SerialLoops`nmkdir -p %{buildroot}/%{_datadir}/applications`ncp -r src/SerialLoops.Gtk/bin/Release/net8.0/linux-x64/publish/* %{buildroot}/%{_libdir}/SerialLoops/`nchmod 777 %{buildroot}/%{_libdir}/SerialLoops/`nln -s %{_libdir}/SerialLoops/SerialLoops %{buildroot}/%{_bindir}/SerialLoops`nprintf `"[Desktop Entry]\nVersion=%{version}\nName=Serial Loops\nComment=Editor for Suzumiya Haruhi no Chokuretsu\nExec=%{_bindir}/SerialLoops\nIcon=%{_libdir}/SerialLoops/Icons/AppIcon.png\nTerminal=false\nType=Application\nCategories=Utility;Application;\n`" > %{buildroot}/%{_datadir}/applications/SerialLoops.desktop`nchmod +x %{buildroot}/%{_datadir}/applications/SerialLoops.desktop`n`n%files`n%dir %{_libdir}/SerialLoops`n%{_bindir}/SerialLoops`n%{_libdir}/SerialLoops`n%{_datadir}/applications/SerialLoops.desktop`n" | Out-File -FilePath rpmbuild/SPECS/SerialLoops.spec
chmod +x $(Build.SourcesDirectory)/install/rpm-scripts/rpm-make.sh
docker run -v $(Build.SourcesDirectory)/install/rpm-scripts:/rpm-scripts -v $(Build.SourcesDirectory)/rpmbuild:/root/rpmbuild -e VERSION=$(Version) fedora:39 /rpm-scripts/rpm-make.sh
displayName: Create Linux tar, dpkg, and rpm
condition: eq(variables['rid'], 'linux-x64')
# We need a second round of publishing to get dmg packing to work. Idk why, but it works if we do it this way lol
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
projects: $(Build.SourcesDirectory)/src/SerialLoops.$(platformName)/SerialLoops.$(platformName).csproj
arguments: '-c Release -f $(framework) -r $(rid) --self-contained /p:DebugType=None /p:DebugSymbols=false /p:PublishSingleFile=true $(extraPublishParams)'
publishWebProjects: false
env:
SLVersion: $(Version)
SLAssemblyVersion: $(AssemblyVersion)
displayName: Publishing Second Round
condition: ne(variables['extraPublishParams'], '')
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(artifactPath)'
ArtifactName: '$(artifactName)'
publishLocation: 'Container'
displayName: Publish build artifact
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(secondArtifactPath)'
ArtifactName: '$(artifactName)-2'
publishLocation: 'Container'
displayName: Publish secondary build artifact
condition: ne(variables['secondArtifactPath'], '')
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(thirdArtifactPath)'
ArtifactName: '$(artifactName)-3'
publishLocation: 'Container'
displayName: Publish tertiary build artifact
condition: ne(variables['thirdArtifactPath'], '')
- stage: Publish
dependsOn: Build
jobs:
- job:
pool:
vmImage: ubuntu-latest
displayName: Create Pre-Release
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Linux artifacts
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Linux-v$(Version)'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download Linux deb
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Linux-v$(Version)-2'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download Linux rpm
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Linux-v$(Version)-3'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download macOS x64 artifacts
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'macOS-x64-v$(Version)'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download macOS ARM artifacts
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'macOS-arm-v$(Version)'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download Windows artifacts
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Windows-v$(Version)'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- pwsh: |
Move-Item -Path $(Build.ArtifactStagingDirectory)/Linux-v$(Version)/publish.tar.gz -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-linux-x64-v$(Version).tar.gz
Move-Item -Path $(Build.ArtifactStagingDirectory)/Linux-v$(Version)-2/SerialLoops.deb -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-$(Version)_amd64.deb
Move-Item -Path $(Build.ArtifactStagingDirectory)/Linux-v$(Version)-3/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)/Serial Loops.dmg" -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-macOS-x64-v$(Version).dmg
Move-Item -Path "$(Build.ArtifactStagingDirectory)/macOS-arm-v$(Version)/Serial Loops.dmg" -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-macOS-arm-v$(Version).dmg
Move-Item -Path $(Build.ArtifactStagingDirectory)/Windows-v$(Version)/publish.zip -Destination $(Build.ArtifactStagingDirectory)/SerialLoops-windows-x64-v$(Version).zip
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
There is currently no Windows installer; instead, you simply download the zip and run the application directly. Because our application contacts GitHub's servers to check for new releases on lauch, it is possible it will get flagged by firewall software – please allow it through so it can function correctly.
### macOS
On macOS, after dragging the app from the dmg into Applications, please run `xattr -cr "/Applications/Serial Loops.app"` from the Terminal in order to be able to run the app. This is required because we currently don't codesign the application, meaning macOS will refuse to run it without explicit approval from you.
#### Which macOS dmg should I choose?
If your Mac is newer, you will probably want the ARM dmg. If it is older, you will 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
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