Update AppImageDesktopFileCreator version #1437
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: .NET Build + Test + Publish | |
| on: | |
| push: | |
| branches: [main, linux-app-image] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-windows: | |
| runs-on: windows-2022 | |
| outputs: | |
| version-number: ${{ steps.version.outputs.number}} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download config repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: TheTrackerCouncil/SMZ3CasConfigs | |
| path: configs | |
| ref: main | |
| - name: Download sprite repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: TheTrackerCouncil/SMZ3CasSprites | |
| path: sprites | |
| ref: main | |
| - name: Download tracker sprite repo | |
| uses: actions/checkout@v4 | |
| 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 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore -p:PostBuildEvent= | |
| - name: Test | |
| run: dotnet test --no-build --verbosity normal | |
| - name: Publish Windows 64bit | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: dotnet publish --os win --arch x64 -c Release --self-contained false src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj | |
| - name: Publish Windows 32bit | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: dotnet publish --os win --arch x86 -c Release --self-contained false src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj | |
| - name: Get version number | |
| if: ${{ github.event_name != 'pull_request' }} | |
| id: version | |
| run: | | |
| $version = (Get-Item "src\TrackerCouncil.Smz3.UI\bin\Release\net8.0\win-x86\publish\SMZ3CasRandomizer.exe").VersionInfo.ProductVersion | |
| $version = $version -replace "\+.*", "" | |
| Write-Output "number=$version" >> $env:GITHUB_OUTPUT | |
| shell: pwsh | |
| - 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 Multiplayer Server package | |
| if: ${{ github.event_name != 'pull_request' }} | |
| working-directory: setup | |
| run: "./MultiplayerServerZipper.ps1" | |
| shell: pwsh | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ github.event_name != 'pull_request' }} | |
| with: | |
| path: "setup/Output/*" | |
| 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 | |
| with: | |
| repository: TheTrackerCouncil/SMZ3CasConfigs | |
| path: configs | |
| ref: main | |
| - name: Download sprite repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: TheTrackerCouncil/SMZ3CasSprites | |
| path: sprites | |
| ref: main | |
| - name: Download tracker sprite repo | |
| uses: actions/checkout@v4 | |
| 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 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Update VersionOverride in source file | |
| 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 | |
| - name: Download AppImageTool | |
| 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 | |
| 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 | |
| with: | |
| repository: TheTrackerCouncil/SMZ3CasConfigs | |
| path: configs | |
| ref: main | |
| - name: Download sprite repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: TheTrackerCouncil/SMZ3CasSprites | |
| path: sprites | |
| ref: main | |
| - name: Download tracker sprite repo | |
| uses: actions/checkout@v4 | |
| 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 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj | |
| - name: Build | |
| run: dotnet build --no-restore -p:PostBuildEvent= src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj | |
| - name: Publish | |
| run: dotnet publish -r osx-arm64 --configuration Release -p:UseAppHost=true src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj | |
| - name: Get version number | |
| id: version | |
| run: | | |
| $version = (Get-Item "src\TrackerCouncil.Smz3.UI\bin\Release\net8.0\osx-arm64\publish\SMZ3CasRandomizer.dll").VersionInfo.ProductVersion | |
| $version = $version -replace "\+.*", "" | |
| $versionShort = $version -replace "\-.*", "" | |
| (Get-Content setup/Info.plist).Replace('%FULL_VERSION%', $version).Replace('%SHORT_VERSION%', $versionShort) | Set-Content setup/Info.plist | |
| Write-Output "number=$version" >> $env:GITHUB_OUTPUT | |
| shell: pwsh | |
| - name: Prepare packaging script | |
| run: | | |
| chmod +x ./setup/package-macos-app.sh | |
| ./setup/package-macos-app.sh "${{ steps.version.outputs.number }}" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: "setup/output/*" | |
| name: SMZ3CasRandomizerMacOS | |
| package: | |
| runs-on: ubuntu-22.04 | |
| needs: [build-windows, build-linux, build-mac] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: SMZ3CasRandomizerWindows | |
| path: out | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: SMZ3CasRandomizerLinux | |
| path: out | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: SMZ3CasRandomizerMacOS | |
| path: out | |
| - name: Extract some files | |
| 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 | |
| uses: geekyeggo/delete-artifact@v5 | |
| with: | |
| name: | | |
| SMZ3CasRandomizerWindows | |
| SMZ3CasRandomizerLinux | |
| SMZ3CasRandomizerMacOS |