Skip to content

Commit 6a98eea

Browse files
Merge pull request #731 from TheTrackerCouncil/linux-app-image
Linux app image
2 parents 51300ab + ee61894 commit 6a98eea

31 files changed

+735
-163
lines changed

.github/workflows/dotnet.yml

Lines changed: 136 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ on:
77
branches: [main]
88

99
jobs:
10-
build:
11-
runs-on: windows-latest
12-
10+
build-windows:
11+
runs-on: windows-2022
12+
outputs:
13+
version-number: ${{ steps.version.outputs.number}}
1314
steps:
1415
- uses: actions/checkout@v4
1516
- name: Download config repo
@@ -66,21 +67,13 @@ jobs:
6667
$version = $version -replace "\+.*", ""
6768
Write-Output "number=$version" >> $env:GITHUB_OUTPUT
6869
shell: pwsh
69-
- name: Publish Linux 64bit
70-
if: ${{ github.event_name != 'pull_request' }}
71-
run: dotnet publish --os linux --arch x64 -c Release --self-contained false src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
7270
- name: Publish Multiplayer Server
7371
if: ${{ github.event_name != 'pull_request' }}
7472
run: dotnet publish -c Release --self-contained false src//TrackerCouncil.Smz3.Multiplayer.Server//TrackerCouncil.Smz3.Multiplayer.Server.csproj
7573
- name: Building the Windows installer
7674
if: ${{ github.event_name != 'pull_request' }}
7775
run: '"%programfiles(x86)%/Inno Setup 6/iscc.exe" "setup/randomizer.app.iss"'
7876
shell: cmd
79-
- name: Building the Linux 64bit package
80-
if: ${{ github.event_name != 'pull_request' }}
81-
working-directory: setup
82-
run: "./LinuxBuildZipper.ps1"
83-
shell: pwsh
8477
- name: Building the Multiplayer Server package
8578
if: ${{ github.event_name != 'pull_request' }}
8679
working-directory: setup
@@ -91,26 +84,105 @@ jobs:
9184
if: ${{ github.event_name != 'pull_request' }}
9285
with:
9386
path: "setup/Output/*"
94-
name: SMZ3CasRandomizer_${{ steps.version.outputs.number }}
87+
name: SMZ3CasRandomizerWindows
88+
89+
build-linux:
90+
runs-on: ubuntu-22.04
91+
needs: [build-windows]
92+
permissions:
93+
contents: write
94+
steps:
95+
- uses: actions/checkout@v4
96+
- name: Download config repo
97+
uses: actions/checkout@v4
98+
if: ${{ github.event_name != 'pull_request' }}
99+
with:
100+
repository: TheTrackerCouncil/SMZ3CasConfigs
101+
path: configs
102+
ref: main
103+
- name: Download sprite repo
104+
uses: actions/checkout@v4
105+
if: ${{ github.event_name != 'pull_request' }}
106+
with:
107+
repository: TheTrackerCouncil/SMZ3CasSprites
108+
path: sprites
109+
ref: main
110+
- name: Download tracker sprite repo
111+
uses: actions/checkout@v4
112+
if: ${{ github.event_name != 'pull_request' }}
113+
with:
114+
repository: TheTrackerCouncil/TrackerSprites
115+
path: trackersprites
116+
ref: main
117+
- name: Download git trees
118+
if: ${{ github.event_name != 'pull_request' }}
119+
shell: pwsh
120+
env:
121+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122+
run: |
123+
$headers = @{
124+
Authorization="Bearer $Env:GH_TOKEN"
125+
}
126+
Invoke-RestMethod -Uri https://api.github.com/repos/TheTrackerCouncil/SMZ3CasSprites/git/trees/main?recursive=1 -OutFile sprites/Sprites/sprites.json -Headers $headers
127+
Invoke-RestMethod -Uri https://api.github.com/repos/TheTrackerCouncil/TrackerSprites/git/trees/main?recursive=1 -OutFile trackersprites/tracker-sprites.json -Headers $headers
128+
Remove-Item -LiteralPath "trackersprites/.git" -Force -Recurse
129+
- name: Setup .NET
130+
uses: actions/setup-dotnet@v4
131+
if: ${{ github.event_name != 'pull_request' }}
132+
with:
133+
dotnet-version: 8.0.x
134+
- name: Update VersionOverride in source file
135+
if: ${{ github.event_name != 'pull_request' }}
136+
run: |
137+
pwd
138+
VERSION="${{ needs.build-windows.outputs.version-number }}"
139+
BASE_VERSION="${VERSION%%-*}"
140+
FILE="src/TrackerCouncil.Smz3.UI/App.axaml.cs"
141+
sed -i -E "s|^[[:space:]]*private static readonly string\?[[:space:]]+s_versionOverride[[:space:]]*=[[:space:]]*null;|private static readonly string? s_versionOverride = \"${VERSION}\";|" "$FILE"
142+
sed -i "s/^AppVersionRelease *= *.*/AppVersionRelease = ${BASE_VERSION}/" setup/AppImage.pupnet.conf
143+
echo "Updated VersionOverride to: ${VERSION}"
144+
- name: Install PupNet
145+
run: dotnet tool install -g KuiperZone.PupNet
146+
if: ${{ github.event_name != 'pull_request' }}
147+
- name: Download AppImageTool
148+
if: ${{ github.event_name != 'pull_request' }}
149+
run: |
150+
wget -P "$HOME/.local/bin" "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
151+
chmod +x "$HOME/.local/bin/appimagetool-x86_64.AppImage"
152+
appimagetool-x86_64.AppImage --version
153+
- name: Run PupNet
154+
if: ${{ github.event_name != 'pull_request' }}
155+
run: |
156+
chmod +x setup/AppImageBundleFiles.sh
157+
pupnet setup/AppImage.pupnet.conf --kind appimage -y
158+
- name: Upload artifact
159+
uses: actions/upload-artifact@v4
160+
if: ${{ github.event_name != 'pull_request' }}
161+
with:
162+
path: "setup/Output/SMZ3CasRandomizer.x86_64*"
163+
name: SMZ3CasRandomizerLinux
164+
95165
build-mac:
96166
runs-on: macos-latest
97-
if: ${{ github.event_name != 'pull_request' }}
98167
steps:
99168
- uses: actions/checkout@v4
100169
- name: Download config repo
101170
uses: actions/checkout@v4
171+
if: ${{ github.event_name != 'pull_request' }}
102172
with:
103173
repository: TheTrackerCouncil/SMZ3CasConfigs
104174
path: configs
105175
ref: main
106176
- name: Download sprite repo
107177
uses: actions/checkout@v4
178+
if: ${{ github.event_name != 'pull_request' }}
108179
with:
109180
repository: TheTrackerCouncil/SMZ3CasSprites
110181
path: sprites
111182
ref: main
112183
- name: Download tracker sprite repo
113184
uses: actions/checkout@v4
185+
if: ${{ github.event_name != 'pull_request' }}
114186
with:
115187
repository: TheTrackerCouncil/TrackerSprites
116188
path: trackersprites
@@ -129,16 +201,21 @@ jobs:
129201
Remove-Item -LiteralPath "trackersprites/.git" -Force -Recurse
130202
- name: Setup .NET
131203
uses: actions/setup-dotnet@v4
204+
if: ${{ github.event_name != 'pull_request' }}
132205
with:
133206
dotnet-version: 8.0.x
134207
- name: Restore dependencies
135208
run: dotnet restore src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
209+
if: ${{ github.event_name != 'pull_request' }}
136210
- name: Build
137211
run: dotnet build --no-restore -p:PostBuildEvent= src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
212+
if: ${{ github.event_name != 'pull_request' }}
138213
- name: Publish
139214
run: dotnet publish -r osx-arm64 --configuration Release -p:UseAppHost=true src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
215+
if: ${{ github.event_name != 'pull_request' }}
140216
- name: Get version number
141217
id: version
218+
if: ${{ github.event_name != 'pull_request' }}
142219
run: |
143220
$version = (Get-Item "src\TrackerCouncil.Smz3.UI\bin\Release\net8.0\osx-arm64\publish\SMZ3CasRandomizer.dll").VersionInfo.ProductVersion
144221
$version = $version -replace "\+.*", ""
@@ -147,11 +224,56 @@ jobs:
147224
Write-Output "number=$version" >> $env:GITHUB_OUTPUT
148225
shell: pwsh
149226
- name: Prepare packaging script
227+
if: ${{ github.event_name != 'pull_request' }}
150228
run: |
151229
chmod +x ./setup/package-macos-app.sh
152230
./setup/package-macos-app.sh "${{ steps.version.outputs.number }}"
153231
- name: Upload artifact
232+
if: ${{ github.event_name != 'pull_request' }}
154233
uses: actions/upload-artifact@v4
155234
with:
156235
path: "setup/output/*"
157-
name: SMZ3CasRandomizerMacOS_${{ steps.version.outputs.number }}
236+
name: SMZ3CasRandomizerMacOS
237+
238+
package:
239+
runs-on: ubuntu-22.04
240+
241+
needs: [build-windows, build-linux, build-mac]
242+
243+
permissions:
244+
contents: write
245+
246+
steps:
247+
- uses: actions/download-artifact@v5
248+
if: ${{ github.event_name != 'pull_request' }}
249+
with:
250+
name: SMZ3CasRandomizerWindows
251+
path: out
252+
- uses: actions/download-artifact@v5
253+
if: ${{ github.event_name != 'pull_request' }}
254+
with:
255+
name: SMZ3CasRandomizerLinux
256+
path: out
257+
- uses: actions/download-artifact@v5
258+
if: ${{ github.event_name != 'pull_request' }}
259+
with:
260+
name: SMZ3CasRandomizerMacOS
261+
path: out
262+
- name: Extract some files
263+
if: ${{ github.event_name != 'pull_request' }}
264+
run: |
265+
ls -alR
266+
- name: Upload artifact
267+
uses: actions/upload-artifact@v4
268+
if: ${{ github.event_name != 'pull_request' }}
269+
with:
270+
path: "out/*"
271+
name: SMZ3CasRandomizer_${{ needs.build-windows.outputs.version-number }}
272+
- name: Delete old artifacts
273+
if: ${{ github.event_name != 'pull_request' }}
274+
uses: geekyeggo/delete-artifact@v5
275+
with:
276+
name: |
277+
SMZ3CasRandomizerWindows
278+
SMZ3CasRandomizerLinux
279+
SMZ3CasRandomizerMacOS

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ healthchecksdb
345345
/Randomizer.CLI/Properties/launchSettings.json
346346
/WebRandomizer/randomizer.db
347347
/asar/
348-
setup/Output/
348+
[Ss]etup/[Oo]utput/
349349
patch-config*
350350
**/.DS_Store
351351
**/*.db

0 commit comments

Comments
 (0)