Skip to content

Commit e2c69fe

Browse files
Initial app image test
1 parent f4045f2 commit e2c69fe

27 files changed

+596
-144
lines changed

.github/workflows/dotnet.yml

Lines changed: 118 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ name: .NET Build + Test + Publish
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, linux-app-image]
66
pull_request:
77
branches: [main]
88

99
jobs:
10-
build:
11-
runs-on: windows-latest
10+
build-windows:
11+
runs-on: windows-2022
12+
13+
outputs:
14+
version-number: ${{ steps.version.outputs.number}}
1215

1316
steps:
1417
- uses: actions/checkout@v4
@@ -66,21 +69,13 @@ jobs:
6669
$version = $version -replace "\+.*", ""
6770
Write-Output "number=$version" >> $env:GITHUB_OUTPUT
6871
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
7272
- name: Publish Multiplayer Server
7373
if: ${{ github.event_name != 'pull_request' }}
7474
run: dotnet publish -c Release --self-contained false src//TrackerCouncil.Smz3.Multiplayer.Server//TrackerCouncil.Smz3.Multiplayer.Server.csproj
7575
- name: Building the Windows installer
7676
if: ${{ github.event_name != 'pull_request' }}
7777
run: '"%programfiles(x86)%/Inno Setup 6/iscc.exe" "setup/randomizer.app.iss"'
7878
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
8479
- name: Building the Multiplayer Server package
8580
if: ${{ github.event_name != 'pull_request' }}
8681
working-directory: setup
@@ -91,7 +86,79 @@ jobs:
9186
if: ${{ github.event_name != 'pull_request' }}
9287
with:
9388
path: "setup/Output/*"
94-
name: SMZ3CasRandomizer_${{ steps.version.outputs.number }}
89+
name: SMZ3CasRandomizerWindows
90+
91+
build-linux:
92+
runs-on: ubuntu-22.04
93+
94+
needs: [build-windows]
95+
96+
permissions:
97+
contents: write
98+
99+
steps:
100+
- uses: actions/checkout@v4
101+
- name: Download config repo
102+
uses: actions/checkout@v4
103+
with:
104+
repository: TheTrackerCouncil/SMZ3CasConfigs
105+
path: configs
106+
ref: main
107+
- name: Download sprite repo
108+
uses: actions/checkout@v4
109+
with:
110+
repository: TheTrackerCouncil/SMZ3CasSprites
111+
path: sprites
112+
ref: main
113+
- name: Download tracker sprite repo
114+
uses: actions/checkout@v4
115+
with:
116+
repository: TheTrackerCouncil/TrackerSprites
117+
path: trackersprites
118+
ref: main
119+
- name: Download git trees
120+
if: ${{ github.event_name != 'pull_request' }}
121+
shell: pwsh
122+
env:
123+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124+
run: |
125+
$headers = @{
126+
Authorization="Bearer $Env:GH_TOKEN"
127+
}
128+
Invoke-RestMethod -Uri https://api.github.com/repos/TheTrackerCouncil/SMZ3CasSprites/git/trees/main?recursive=1 -OutFile sprites/Sprites/sprites.json -Headers $headers
129+
Invoke-RestMethod -Uri https://api.github.com/repos/TheTrackerCouncil/TrackerSprites/git/trees/main?recursive=1 -OutFile trackersprites/tracker-sprites.json -Headers $headers
130+
Remove-Item -LiteralPath "trackersprites/.git" -Force -Recurse
131+
- name: Setup .NET
132+
uses: actions/setup-dotnet@v4
133+
with:
134+
dotnet-version: 8.0.x
135+
- name: Update VersionOverride in source file
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+
- name: Download AppImageTool
147+
run: |
148+
wget -P "$HOME/.local/bin" "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
149+
chmod +x "$HOME/.local/bin/appimagetool-x86_64.AppImage"
150+
appimagetool-x86_64.AppImage --version
151+
- name: Run PupNet
152+
run: |
153+
chmod +x setup/AppImageBundleFiles.sh
154+
pupnet setup/AppImage.pupnet.conf --kind appimage -y
155+
- name: Upload artifact
156+
uses: actions/upload-artifact@v4
157+
if: ${{ github.event_name != 'pull_request' }}
158+
with:
159+
path: "setup/Output/SMZ3CasRandomizer.x86_64*"
160+
name: SMZ3CasRandomizerLinux
161+
95162
build-mac:
96163
runs-on: macos-latest
97164
if: ${{ github.event_name != 'pull_request' }}
@@ -154,4 +221,42 @@ jobs:
154221
uses: actions/upload-artifact@v4
155222
with:
156223
path: "setup/output/*"
157-
name: SMZ3CasRandomizerMacOS_${{ steps.version.outputs.number }}
224+
name: SMZ3CasRandomizerMacOS
225+
226+
package:
227+
runs-on: ubuntu-22.04
228+
229+
needs: [build-windows, build-linux, build-mac]
230+
231+
permissions:
232+
contents: write
233+
234+
steps:
235+
- uses: actions/download-artifact@v5
236+
with:
237+
name: SMZ3CasRandomizerWindows
238+
path: out
239+
- uses: actions/download-artifact@v5
240+
with:
241+
name: SMZ3CasRandomizerLinux
242+
path: out
243+
- uses: actions/download-artifact@v5
244+
with:
245+
name: SMZ3CasRandomizerMacOS
246+
path: out
247+
- name: Extract some files
248+
run: |
249+
ls -alR
250+
- name: Upload artifact
251+
uses: actions/upload-artifact@v4
252+
if: ${{ github.event_name != 'pull_request' }}
253+
with:
254+
path: "out/*"
255+
name: SMZ3CasRandomizer_${{ needs.build-windows.outputs.version-number }}
256+
- name: Delete old artifacts
257+
uses: geekyeggo/delete-artifact@v5
258+
with:
259+
name: |
260+
SMZ3CasRandomizerWindows
261+
SMZ3CasRandomizerLinux
262+
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

setup/AppImage.pupnet.conf

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
################################################################################
2+
# PUPNET DEPLOY: 1.9.0
3+
################################################################################
4+
5+
########################################
6+
# APP PREAMBLE
7+
########################################
8+
9+
# Mandatory application base name. This MUST BE the base name of the main executable file. It should NOT
10+
# include any directory part or extension, i.e. do not append '.exe' or '.dll'. It should not contain
11+
# spaces or invalid filename characters.
12+
AppBaseName = SMZ3CasRandomizer
13+
14+
# Mandatory application friendly name.
15+
AppFriendlyName = "SMZ3 Cas' Randomizer"
16+
17+
# Mandatory application ID in reverse DNS form. The value should stay constant for lifetime of the software.
18+
AppId = org.trackercouncil.smz3
19+
20+
# Mandatory application version and package release of form: 'VERSION[RELEASE]'. Use optional square
21+
# brackets to denote package release, i.e. '1.2.3[1]'. Release refers to a change to the deployment
22+
# package, rather the application. If release part is absent (i.e. '1.2.3'), the release value defaults
23+
# to '1'. Note that the version-release value given here may be overridden from the command line.
24+
AppVersionRelease = 1.0.0
25+
26+
# Mandatory single line application summary text in default (English) language.
27+
AppShortSummary = "Casual standalone version of the SMZ3 randomizer"
28+
29+
# Multi-line (surround with triple """ quotes) application description which provides longer explanation
30+
# than AppShortSummary in default language. Optional but it is recommended to specify this. Text
31+
# separated by an empty line will be treated as separate paragraphs. Avoid complex formatting, and do not
32+
# use HTML or markdown, other than list items beginning with "* ", "+ " or "- ". This content is
33+
# used by package builders where supported, including RPM and DEB, and is used to populate the
34+
# ${APPSTREAM_DESCRIPTION_XML} element used within AppStream metadata.
35+
AppDescription = """
36+
UI application for selecting, randomizing, and shuffling MSUs for various rom hacks and randomizers.
37+
"""
38+
39+
# Mandatory application license ID. This should be one of the recognized SPDX license
40+
# identifiers, such as: 'MIT', 'GPL-3.0-or-later' or 'Apache-2.0'. For a proprietary or
41+
# custom license, use 'LicenseRef-Proprietary' or 'LicenseRef-LICENSE'.
42+
AppLicenseId = MIT
43+
44+
# Optional path to application copyright/license text file. If provided, it will be packaged with the
45+
# application and used with package builders where supported.
46+
AppLicenseFile = ../LICENSE
47+
48+
# Optional path to application changelog file. IMPORTANT. If given, this file should contain version
49+
# information in a predefined format. Namely, it should contain one or more version headings of form:
50+
# '+ VERSION;DATE', under which are to be listed change items of form: '- Change description'. Formatted
51+
# information will be parsed and used to expand the ${APPSTREAM_CHANGELOG_XML} macro used
52+
# for AppStream metadata (superfluous text is ignored, so the file may also contain README information).
53+
# The given file will also be packaged with the application verbatim. See: https://github.com/kuiperzone/PupNet-Deploy.
54+
AppChangeFile =
55+
56+
########################################
57+
# PUBLISHER
58+
########################################
59+
60+
# Mandatory publisher, group or creator name.
61+
PublisherName = The Tracker Council
62+
63+
# Publisher ID in reverse DNS form. Invariably, this would be the same as AppId, excluding the app leaf
64+
# name. The value populates the ${PUBLISHER_ID} macro used AppStream metainfo. If omitted, defaults to
65+
# the leading parts of AppId. It is highly recommended to specify the value explicitly.
66+
PublisherId = org.trackercouncil
67+
68+
# Optional copyright statement.
69+
PublisherCopyright =
70+
71+
# Optional publisher or application web-link name. Note that Windows Setup packages
72+
# require both PublisherLinkName and PublisherLinkUrl in order to include the link as
73+
# an item in program menu entries. Do not modify name, as may leave old entries in updated installations.
74+
PublisherLinkName = Home Page
75+
76+
# Publisher or application web-link URL. Although optional, it should be considered mandatory if using
77+
# MetaFile
78+
PublisherLinkUrl = https://github.com/TheTrackerCouncil
79+
80+
# Publisher or maintainer email contact. Although optional, some package builders (i.e. DEB) require it
81+
# and may warn or fail unless provided.
82+
PublisherEmail =
83+
84+
########################################
85+
# DESKTOP INTEGRATION
86+
########################################
87+
88+
# Boolean (true or false) which indicates whether the application is hidden on the desktop. It is used to
89+
# populate the 'NoDisplay' field of the .desktop file. The default is false. Setting to true will also
90+
# cause the main application start menu entry to be omitted for Windows Setup.
91+
DesktopNoDisplay = false
92+
93+
# Boolean (true or false) which indicates whether the application runs in the terminal, rather than
94+
# providing a GUI. It is used to populate the 'Terminal' field of the .desktop file.
95+
DesktopTerminal = false
96+
97+
# Optional path to a Linux desktop file. If empty (default), one will be generated automatically from
98+
# the information in this file. Supplying a custom file, however, allows for mime-types and
99+
# internationalisation. If supplied, the file MUST contain the line: 'Exec=${INSTALL_EXEC}'
100+
# in order to use the correct install location. Other macros may be used to help automate the content.
101+
# Note. PupNet Deploy can generate you a desktop file. Use --help and 'pupnet --help macro' for reference.
102+
# See: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
103+
DesktopFile = Smz3CasRandomizer.desktop
104+
105+
# Optional command name to start the application from the terminal. If, for example, AppBaseName is
106+
# 'Zone.Kuiper.HelloWorld', the value here may be set to a simpler and/or lower-case variant such as
107+
# 'helloworld'. It must not contain spaces or invalid filename characters. Do not add any extension such
108+
# as '.exe'. If empty, the application will not be in the path and cannot be started from the command line.
109+
# For Windows Setup packages, see also SetupCommandPrompt. StartCommand is not
110+
# supported for all packages kinds (i.e. Flatpak). Default is empty (none).
111+
StartCommand = SMZ3CasRandomizer
112+
113+
# Optional category for the application. The value should be one of the recognized Freedesktop top-level
114+
# categories, such as: Audio, Development, Game, Office, Utility etc. Only a single value should be
115+
# provided here which will be used, where supported, to populate metadata. The default is empty.
116+
# See: https://specifications.freedesktop.org/menu-spec/latest/apa.html
117+
PrimeCategory = Game
118+
119+
# Path to AppStream metadata file. It is optional, but recommended as it is used by software centers.
120+
# Note. The contents of the files may use macro variables. Use 'pupnet --help macro' for reference.
121+
# See: https://docs.appimage.org/packaging-guide/optional/appstream.html
122+
MetaFile = app.metainfo.xml
123+
124+
# Optional icon file paths. The value may include multiple filenames separated with semicolon or given
125+
# in multi-line form. Valid types are SVG, PNG and ICO (ICO ignored on Linux). Note that the inclusion
126+
# of a scalable SVG is preferable on Linux, whereas PNGs must be one of the standard sizes and MUST
127+
# include the size in the filename in the form: name.32x32.png' or 'name.32.png'.
128+
IconFiles = """
129+
Icons/icon.512.png
130+
Icons/icon.256.png
131+
Icons/icon.128.png
132+
Icons/icon.64.png
133+
Icons/icon.48.png
134+
Icons/icon.32.png
135+
Icons/icon.24.png
136+
Icons/icon.16.png
137+
Icons/icon.svg
138+
"""
139+
140+
########################################
141+
# DOTNET PUBLISH
142+
########################################
143+
144+
# Optional path relative to this file in which to find the dotnet project (.csproj) file, or the
145+
# directory containing it. If empty (default), a single project file is expected under the same
146+
# directory as this file. IMPORTANT. If set to 'NONE', dotnet publish is disabled
147+
# (i.e. not called). Instead, only DotnetPostPublish is called.
148+
DotnetProjectPath = ../src/TrackerCouncil.Smz3.UI
149+
150+
# Optional arguments supplied to 'dotnet publish'. Do NOT include '-r' (runtime), or '-c' (configuration)
151+
# here as they will be added according to command line arguments. Typically you want as a minimum:
152+
# '-p:Version=${APP_VERSION} --self-contained true'. Additional useful arguments include:
153+
# '-p:DebugType=None -p:DebugSymbols=false -p:PublishSingleFile=true -p:PublishReadyToRun=true
154+
# -p:PublishTrimmed=true -p:TrimMode=link'. Note. This value may use macro variables. Use 'pupnet --help macro'
155+
# for reference. See: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
156+
DotnetPublishArgs = -p:Version=${APP_VERSION} --self-contained true -p:DebugType=None -p:DebugSymbols=false
157+
158+
DotnetPostPublish = AppImageBundleFiles.sh
159+
160+
########################################
161+
# PACKAGE OUTPUT
162+
########################################
163+
164+
# Optional package name (excludes version etc.). If empty, defaults to AppBaseName. However, it is
165+
# used not only to specify the base output filename, but to identify the application in DEB and RPM
166+
# packages. You may wish, therefore, to ensure that the value represents a unique name. Naming
167+
# requirements are strict and must contain only alpha-numeric and '-', '+' and '.' characters.
168+
PackageName = SMZ3CasRandomizer
169+
170+
# Output directory, or subdirectory relative to this file. It will be created if it does not exist and
171+
# will contain the final deploy output files. If empty, it defaults to the location of this file.
172+
OutputDirectory = Output
173+
174+
########################################
175+
# APPIMAGE OPTIONS
176+
########################################
177+
178+
# Additional arguments for use with appimagetool, i.e. '--no-appstream' to disable pedantic metadata checking.
179+
# Use for signing with '--sign'. Default is empty.
180+
AppImageArgs =
181+
182+
# Optional path to AppImage fuse runtime(s), but not to be confused with .NET runtime ID. If AppImageRuntimePath is
183+
# left empty (default), appimagetool will download the latest runtime automatically. Specifying a path here avoids
184+
# the need for an internet connection during build, and fixes the runtime version. If AppImageRuntimePath
185+
# points to a file, the value is supplied directly to appimagetool using '--runtime-file'. If it points to a
186+
# directory, the directory should contain expected runtimes, which will be selected for the target architecture,
187+
# namely one of: runtime-aarch64, runtime-armhf, runtime-i686 or runtime-x86_64. Runtimes can be downloaded:
188+
# https://github.com/AppImage/type2-runtime/releases
189+
AppImageRuntimePath =
190+
191+
# Boolean (true or false) which sets whether to include the application version in the AppImage filename,
192+
# i.e. 'HelloWorld-1.2.3-x86_64.AppImage'. Default is false. It is ignored if the output filename is
193+
# specified at command line.
194+
AppImageVersionOutput = false
195+
196+
197+
FlatpakPlatformRuntime = 1.0.0
198+
FlatpakPlatformSdk = 1.0.0
199+
FlatpakPlatformVersion = 1.0.0
200+
SetupMinWindowsVersion = 1.0.0

setup/AppImageBundleFiles.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
echo "BUILD_ARCH: ${BUILD_ARCH}"
4+
echo "BUILD_TARGET: ${BUILD_TARGET}"
5+
echo "BUILD_SHARE: ${BUILD_SHARE}"
6+
echo "BUILD_APP_BIN: ${BUILD_APP_BIN}"
7+
8+
mkdir ${BUILD_APP_BIN}/DefaultData
9+
mv sprites/Sprites ${BUILD_APP_BIN}/DefaultData/Sprites
10+
mv trackersprites ${BUILD_APP_BIN}/DefaultData/TrackerSprites
11+
mv configs/Profiles ${BUILD_APP_BIN}/DefaultData/Configs
12+
mv configs/Schemas ${BUILD_APP_BIN}/DefaultData/Schemas
13+
14+
UNIQUE_ID=$(uuidgen)
15+
echo "$UNIQUE_ID" >> ${BUILD_APP_BIN}/DefaultData/id.txt
16+
17+
ls -al ${BUILD_APP_BIN}/DefaultData
18+

setup/Icons/icon.128.png

974 Bytes
Loading

setup/Icons/icon.16.png

350 Bytes
Loading

setup/Icons/icon.24.png

606 Bytes
Loading

setup/Icons/icon.256.png

1.38 KB
Loading

setup/Icons/icon.32.png

395 Bytes
Loading

setup/Icons/icon.48.png

648 Bytes
Loading

0 commit comments

Comments
 (0)