Create app image desktop file #15
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, appimage] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-windows: | |
| runs-on: windows-2022 | |
| permissions: | |
| contents: write | |
| outputs: | |
| version-number: ${{ steps.version.outputs.number}} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dsaltares/fetch-gh-release-asset@master | |
| with: | |
| repo: "MattEqualsCoder/ALttPMSUShuffler" | |
| file: "msu_types.json" | |
| target: "MSURandomizerLibrary/msu_types.json" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.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: Clean | |
| run: dotnet clean | |
| - name: Build | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: dotnet build --no-restore --configuration Release -p:PostBuildEvent= | |
| - name: Publish Windows 64bit | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: dotnet publish --os win --arch x64 -f net9.0 -c Release --self-contained false MSURandomizer/MSURandomizer.csproj | |
| - name: Publish Windows 32bit | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: dotnet publish --os win --arch x86 -f net9.0 -c Release --self-contained false MSURandomizer/MSURandomizer.csproj | |
| - name: Publish Windows 64bit | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: dotnet publish -f net9.0 | |
| - name: Get version number | |
| if: ${{ github.event_name != 'pull_request' }} | |
| id: version | |
| run: | | |
| $version = (Get-Item "MSURandomizer\bin\Release\net9.0\win-x86\publish\MSURandomizer.exe").VersionInfo.ProductVersion | |
| $version = $version -replace "\+.*", "" | |
| Write-Output "number=$version" >> $env:GITHUB_OUTPUT | |
| shell: pwsh | |
| - name: Building the Windows installer | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: '"%programfiles(x86)%/Inno Setup 6/iscc.exe" "setup/MSURandomizer.iss"' | |
| shell: cmd | |
| - name: Copy Nuget Packages | |
| if: ${{ github.event_name != 'pull_request' }} | |
| working-directory: setup | |
| run: "./CopyNugetPackages.ps1" | |
| shell: pwsh | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ github.event_name != 'pull_request' }} | |
| with: | |
| path: "setup/Output/*" | |
| name: MSURandomizerWindows | |
| build-linux: | |
| runs-on: ubuntu-22.04 | |
| needs: [build-windows] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dsaltares/fetch-gh-release-asset@master | |
| with: | |
| repo: "MattEqualsCoder/ALttPMSUShuffler" | |
| file: "msu_types.json" | |
| target: "MSURandomizerLibrary/msu_types.json" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| - 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: | | |
| version_number="${{ needs.build-windows.outputs.version-number }}" | |
| base_version="${version_number%%-*}" | |
| cat Setup/AppImage.pupnet.conf | |
| sed -i "s/^AppVersionRelease *= *.*/AppVersionRelease = ${base_version}/" Setup/AppImage.pupnet.conf | |
| cat Setup/AppImage.pupnet.conf | |
| 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/MSURandomizer*.AppImage" | |
| name: MSURandomizerLinux | |
| package: | |
| runs-on: ubuntu-22.04 | |
| needs: [build-windows, build-linux] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: MSURandomizerWindows | |
| path: out | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: MSURandomizerLinux | |
| 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: MSURandomizer_${{ needs.build-windows.outputs.version-number }} | |
| - name: Delete old artifacts | |
| uses: geekyeggo/delete-artifact@v5 | |
| with: | |
| name: | | |
| MSURandomizerWindows | |
| MSURandomizerLinux |