Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 136 additions & 14 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ on:
branches: [main]

jobs:
build:
runs-on: windows-latest

build-windows:
runs-on: windows-2022
outputs:
version-number: ${{ steps.version.outputs.number}}
steps:
- uses: actions/checkout@v4
- name: Download config repo
Expand Down Expand Up @@ -66,21 +67,13 @@ jobs:
$version = $version -replace "\+.*", ""
Write-Output "number=$version" >> $env:GITHUB_OUTPUT
shell: pwsh
- name: Publish Linux 64bit
if: ${{ github.event_name != 'pull_request' }}
run: dotnet publish --os linux --arch x64 -c Release --self-contained false src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
- name: Publish Multiplayer Server
if: ${{ github.event_name != 'pull_request' }}
run: dotnet publish -c Release --self-contained false src//TrackerCouncil.Smz3.Multiplayer.Server//TrackerCouncil.Smz3.Multiplayer.Server.csproj
- name: Building the Windows installer
if: ${{ github.event_name != 'pull_request' }}
run: '"%programfiles(x86)%/Inno Setup 6/iscc.exe" "setup/randomizer.app.iss"'
shell: cmd
- name: Building the Linux 64bit package
if: ${{ github.event_name != 'pull_request' }}
working-directory: setup
run: "./LinuxBuildZipper.ps1"
shell: pwsh
- name: Building the Multiplayer Server package
if: ${{ github.event_name != 'pull_request' }}
working-directory: setup
Expand All @@ -91,26 +84,105 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
with:
path: "setup/Output/*"
name: SMZ3CasRandomizer_${{ steps.version.outputs.number }}
name: SMZ3CasRandomizerWindows

build-linux:
runs-on: ubuntu-22.04
needs: [build-windows]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download config repo
uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' }}
with:
repository: TheTrackerCouncil/SMZ3CasConfigs
path: configs
ref: main
- name: Download sprite repo
uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' }}
with:
repository: TheTrackerCouncil/SMZ3CasSprites
path: sprites
ref: main
- name: Download tracker sprite repo
uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' }}
with:
repository: TheTrackerCouncil/TrackerSprites
path: trackersprites
ref: main
- name: Download git trees
if: ${{ github.event_name != 'pull_request' }}
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$headers = @{
Authorization="Bearer $Env:GH_TOKEN"
}
Invoke-RestMethod -Uri https://api.github.com/repos/TheTrackerCouncil/SMZ3CasSprites/git/trees/main?recursive=1 -OutFile sprites/Sprites/sprites.json -Headers $headers
Invoke-RestMethod -Uri https://api.github.com/repos/TheTrackerCouncil/TrackerSprites/git/trees/main?recursive=1 -OutFile trackersprites/tracker-sprites.json -Headers $headers
Remove-Item -LiteralPath "trackersprites/.git" -Force -Recurse
- name: Setup .NET
uses: actions/setup-dotnet@v4
if: ${{ github.event_name != 'pull_request' }}
with:
dotnet-version: 8.0.x
- name: Update VersionOverride in source file
if: ${{ github.event_name != 'pull_request' }}
run: |
pwd
VERSION="${{ needs.build-windows.outputs.version-number }}"
BASE_VERSION="${VERSION%%-*}"
FILE="src/TrackerCouncil.Smz3.UI/App.axaml.cs"
sed -i -E "s|^[[:space:]]*private static readonly string\?[[:space:]]+s_versionOverride[[:space:]]*=[[:space:]]*null;|private static readonly string? s_versionOverride = \"${VERSION}\";|" "$FILE"
sed -i "s/^AppVersionRelease *= *.*/AppVersionRelease = ${BASE_VERSION}/" setup/AppImage.pupnet.conf
echo "Updated VersionOverride to: ${VERSION}"
- name: Install PupNet
run: dotnet tool install -g KuiperZone.PupNet
if: ${{ github.event_name != 'pull_request' }}
- name: Download AppImageTool
if: ${{ github.event_name != 'pull_request' }}
run: |
wget -P "$HOME/.local/bin" "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x "$HOME/.local/bin/appimagetool-x86_64.AppImage"
appimagetool-x86_64.AppImage --version
- name: Run PupNet
if: ${{ github.event_name != 'pull_request' }}
run: |
chmod +x setup/AppImageBundleFiles.sh
pupnet setup/AppImage.pupnet.conf --kind appimage -y
- name: Upload artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'pull_request' }}
with:
path: "setup/Output/SMZ3CasRandomizer.x86_64*"
name: SMZ3CasRandomizerLinux

build-mac:
runs-on: macos-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v4
- name: Download config repo
uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' }}
with:
repository: TheTrackerCouncil/SMZ3CasConfigs
path: configs
ref: main
- name: Download sprite repo
uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' }}
with:
repository: TheTrackerCouncil/SMZ3CasSprites
path: sprites
ref: main
- name: Download tracker sprite repo
uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' }}
with:
repository: TheTrackerCouncil/TrackerSprites
path: trackersprites
Expand All @@ -129,16 +201,21 @@ jobs:
Remove-Item -LiteralPath "trackersprites/.git" -Force -Recurse
- name: Setup .NET
uses: actions/setup-dotnet@v4
if: ${{ github.event_name != 'pull_request' }}
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
if: ${{ github.event_name != 'pull_request' }}
- name: Build
run: dotnet build --no-restore -p:PostBuildEvent= src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
if: ${{ github.event_name != 'pull_request' }}
- name: Publish
run: dotnet publish -r osx-arm64 --configuration Release -p:UseAppHost=true src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
if: ${{ github.event_name != 'pull_request' }}
- name: Get version number
id: version
if: ${{ github.event_name != 'pull_request' }}
run: |
$version = (Get-Item "src\TrackerCouncil.Smz3.UI\bin\Release\net8.0\osx-arm64\publish\SMZ3CasRandomizer.dll").VersionInfo.ProductVersion
$version = $version -replace "\+.*", ""
Expand All @@ -147,11 +224,56 @@ jobs:
Write-Output "number=$version" >> $env:GITHUB_OUTPUT
shell: pwsh
- name: Prepare packaging script
if: ${{ github.event_name != 'pull_request' }}
run: |
chmod +x ./setup/package-macos-app.sh
./setup/package-macos-app.sh "${{ steps.version.outputs.number }}"
- name: Upload artifact
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v4
with:
path: "setup/output/*"
name: SMZ3CasRandomizerMacOS_${{ steps.version.outputs.number }}
name: SMZ3CasRandomizerMacOS

package:
runs-on: ubuntu-22.04

needs: [build-windows, build-linux, build-mac]

permissions:
contents: write

steps:
- uses: actions/download-artifact@v5
if: ${{ github.event_name != 'pull_request' }}
with:
name: SMZ3CasRandomizerWindows
path: out
- uses: actions/download-artifact@v5
if: ${{ github.event_name != 'pull_request' }}
with:
name: SMZ3CasRandomizerLinux
path: out
- uses: actions/download-artifact@v5
if: ${{ github.event_name != 'pull_request' }}
with:
name: SMZ3CasRandomizerMacOS
path: out
- name: Extract some files
if: ${{ github.event_name != 'pull_request' }}
run: |
ls -alR
- name: Upload artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'pull_request' }}
with:
path: "out/*"
name: SMZ3CasRandomizer_${{ needs.build-windows.outputs.version-number }}
- name: Delete old artifacts
if: ${{ github.event_name != 'pull_request' }}
uses: geekyeggo/delete-artifact@v5
with:
name: |
SMZ3CasRandomizerWindows
SMZ3CasRandomizerLinux
SMZ3CasRandomizerMacOS
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ healthchecksdb
/Randomizer.CLI/Properties/launchSettings.json
/WebRandomizer/randomizer.db
/asar/
setup/Output/
[Ss]etup/[Oo]utput/
patch-config*
**/.DS_Store
**/*.db
Expand Down
Loading