Official release build for Serial Loops #44
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: Serial Loops Official Build | |
| run-name: "Official release build for Serial Loops" | |
| on: | |
| # schedule: | |
| # - cron: '35 0 * * *' | |
| # - cron: '35 4 * * *' | |
| # - cron: '35 8 * * *' | |
| # - cron: '35 12 * * *' | |
| # - cron: '35 16 * * *' | |
| # - cron: '35 20 * * *' | |
| push: | |
| branches: | |
| - 'main' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Release version | |
| required: true | |
| type: string | |
| releaseNotes: | |
| description: Release notes | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| env: | |
| SLVersion: ${{ inputs.version == '' && format('0.3.apre.{0}', github.run_number) || inputs.version }} | |
| SLAssemblyVersion: ${{ inputs.version == '' && format('0.3.8888.{0}', github.run_number) || inputs.version }} | |
| jobs: | |
| # check-new-commits: | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - name: Check out | |
| # uses: actions/checkout@v4 | |
| # - name: Check if new commits | |
| # run: echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_ENV | |
| # if: ${{ github.event_name == 'schedule' }} | |
| # - name: Pass because dispatched | |
| # run: echo "NEW_COMMIT_COUNT=1" >> $GITHUB_ENV | |
| # if: ${{ github.event_name != 'schedule' }} | |
| linux-flatpak-setup: | |
| # needs: check-new-commits | |
| # if: ${{ github.env.NEW_COMMIT_COUNT > 0 }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4.1.0 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - run: pip install requests | |
| - run: python install/linux/flatpak/flatpak-dotnet-generator.py --dotnet 8 --freedesktop 23.08 nuget-sources.json src/SerialLoops/SerialLoops.csproj | |
| - name: Publish nuget-sources.json | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-sources | |
| path: nuget-sources.json | |
| retention-days: 1 | |
| - name: Export devkitARM latest | |
| uses: addnab/docker-run-action@v3 | |
| with: | |
| image: devkitpro/devkitarm:latest | |
| options: -v ${{ github.workspace }}:/work -w /work | |
| run: tar -czvf devkitarm.tar.gz /opt/devkitpro/devkitARM /opt/devkitpro/libnds | |
| - name: Publish devkitARM tarball | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: devkitARM | |
| path: devkitarm.tar.gz | |
| retention-days: 1 | |
| linux-flatpak: | |
| needs: linux-flatpak-setup | |
| runs-on: ubuntu-latest | |
| container: | |
| image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08 | |
| options: --privileged | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Download nuget-sources.json | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: nuget-sources | |
| path: install/linux/flatpak/ | |
| - name: Download devkitARM | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: devkitARM | |
| path: install/linux/flatpak/ | |
| - name: Export version | |
| run: echo $SLVersion > install/linux/flatpak/VERSION | |
| - name: Build flatpak | |
| uses: flatpak/flatpak-github-actions/flatpak-builder@v6 | |
| with: | |
| manifest-path: install/linux/flatpak/club.haroohie.SerialLoops.yaml | |
| bundle: SerialLoops.flatpak | |
| cache-key: flatpak-builder-${{ github.sha }} | |
| - name: Upload flatpak | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-x64-flatpak | |
| path: SerialLoops.flatpak | |
| retention-days: 1 | |
| linux-appimage: | |
| runs-on: ubuntu-latest | |
| # needs: check-new-commits | |
| # if: ${{ github.env.NEW_COMMIT_COUNT > 0 }} | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4.1.0 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Build & Publish Serial Loops | |
| run: dotnet publish src/SerialLoops/SerialLoops.csproj -c Release -f net8.0 -r linux-x64 --self-contained /p:DebugType=None /p:DebugSymbols=false /p:PublishSingleFile=true | |
| - name: Set up AppDir | |
| run: | | |
| sed -i "s/#VERSION#/$SLVersion/g" ./install/linux/appimage/AppImageBuilder.yml | |
| mkdir -p ./install/linux/appimage/AppDir/usr/bin | |
| chmod +x ./src/SerialLoops/bin/Release/net8.0/linux-x64/publish/SerialLoops | |
| mv ./src/SerialLoops/bin/Release/net8.0/linux-x64/publish/* ./install/linux/appimage/AppDir/usr/bin/ | |
| mkdir -p ./install/linux/appimage/AppDir/usr/share/icons/default/scalable/apps/ | |
| cp ./src/SerialLoops/Assets/Icons/AppIcon.svg ./install/linux/appimage/AppDir/usr/share/icons/default/scalable/apps/club.haroohie.SerialLoops.svg | |
| - name: Build AppImage | |
| uses: addnab/docker-run-action@v3 | |
| with: | |
| image: ghcr.io/haroohie-club/appimage-builder:main | |
| options: -v ${{ github.workspace }}:/work -w /work | |
| run: appimage-builder --recipe=./install/linux/appimage/AppImageBuilder.yml --skip-tests | |
| - name: Upload AppImage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-x64-appimage | |
| path: SerialLoops.AppImage | |
| retention-days: 1 | |
| linux-dpkg-tarball: | |
| # needs: check-new-commits | |
| # if: ${{ github.env.NEW_COMMIT_COUNT > 0 }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4.1.0 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Build & Publish Serial Loops | |
| run: dotnet publish src/SerialLoops/SerialLoops.csproj -c Release -f net8.0 -r linux-x64 --self-contained /p:DebugType=None /p:DebugSymbols=false /p:PublishSingleFile=true | |
| - name: Create tarball | |
| run: | | |
| chmod +x ./src/SerialLoops/bin/Release/net8.0/linux-x64/publish/SerialLoops | |
| pushd ./src/SerialLoops/bin/Release/net8.0/linux-x64/publish | |
| tar -czvf ../SerialLoops.tar.gz --transform "s,^\.\/,SerialLoops-$SLVersion/," . | |
| popd | |
| - name: Upload tarball | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-x64-tarball | |
| path: src/SerialLoops/bin/Release/net8.0/linux-x64/SerialLoops.tar.gz | |
| retention-days: 1 | |
| - name: Create deb package | |
| shell: pwsh | |
| run: | | |
| Copy-Item -Path ./install/linux/dpkg-build -Destination ./dpkg-build -Recurse -Exclude ".gitkeep" | |
| New-Item -ItemType "directory" -Path ./dpkg-build/SerialLoops/usr -Name bin | |
| Push-Location ./dpkg-build/SerialLoops | |
| ((Get-Content -Path DEBIAN/control) -replace '#VERSION#', "$env:SLVersion") | Set-Content -Path DEBIAN/control | |
| ((Get-Content -Path usr/share/applications/SerialLoops.desktop) -replace '#VERSION#', "$env:SLVersion") | Set-Content -Path usr/share/applications/SerialLoops.desktop | |
| Copy-Item -Path ../../src/SerialLoops/bin/Release/net8.0/linux-x64/publish/* -Destination ./usr/lib/SerialLoops -Recurse | |
| ln -s /usr/lib/SerialLoops/SerialLoops usr/bin/SerialLoops | |
| Copy-Item -Path ../../src/SerialLoops/Assets/Icons/AppIcon.png usr/lib/SerialLoops/SerialLoops.png | |
| Set-Location .. | |
| dpkg-deb --build SerialLoops | |
| Pop-Location | |
| - name: Upload dpkg | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-x64-dpkg | |
| path: dpkg-build/SerialLoops.deb | |
| retention-days: 1 | |
| linux-rpm: | |
| # needs: check-new-commits | |
| # if: ${{ github.env.NEW_COMMIT_COUNT > 0 }} | |
| runs-on: ubuntu-latest | |
| container: | |
| image: fedora:39 | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Create RPM | |
| run: | | |
| cp -r install/linux/rpm/rpmbuild ~/ | |
| tar -czvf ~/rpmbuild/SOURCES/SerialLoops-$SLVersion.tar.gz --transform "s,^\.\/,SerialLoops-$SLVersion/," . | |
| sed -i "s/#VERSION#/$SLVersion/g" ~/rpmbuild/SPECS/SerialLoops.spec | |
| dnf install -y rpmdevtools rpmlint dotnet-sdk-8.0 | |
| pushd ~ | |
| rpmbuild -bb rpmbuild/SPECS/SerialLoops.spec | |
| popd | |
| mv ~/rpmbuild/RPMS/x86_64/SerialLoops-${{ env.SLVersion }}-1.fc39.x86_64.rpm SerialLoops.rpm | |
| - name: Upload rpm | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-x64-rpm | |
| path: SerialLoops.rpm | |
| retention-days: 1 | |
| macos-pkg: | |
| # needs: check-new-commits | |
| # if: ${{ github.env.NEW_COMMIT_COUNT > 0 }} | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| type: [ { rid: 'osx-x64', arch: 'x86_64 ' }, { rid: 'osx-arm64', arch: 'arm64' } ] | |
| steps: | |
| - name: Check out Serial Loops | |
| uses: actions/checkout@v4 | |
| - name: Check out SDL | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'libsdl-org/SDL' | |
| ref: release-2.32.x | |
| path: SDL | |
| - name: SDL cmake configure | |
| run: pushd ${{ github.workspace }}/SDL && cmake -S . -B build -DSDL_SHARED=ON -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES="${{ matrix.type.arch }}" && popd | |
| - name: SDL cmake build | |
| run: pushd ${{ github.workspace }}/SDL && cmake --build build && popd | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4.1.0 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - run: pip install macos-pkg-builder | |
| - name: Copy in SDL | |
| run: cp -L ${{ github.workspace }}/SDL/build/libSDL2-2.0.dylib "src/SerialLoops/libSDL2.dylib" | |
| - name: Restore | |
| run: dotnet restore src/SerialLoops/SerialLoops.csproj -r ${{ matrix.type.rid }} | |
| - name: Build .app | |
| run: dotnet msbuild src/SerialLoops/SerialLoops.csproj -t:BundleApp -p:Configuration=Release -p:TargetFramework=net8.0 -p:RuntimeIdentifier=${{ matrix.type.rid }} -p:UseAppHost=true -p:SelfContained=true -p:DebugType=None -p:DebugSymbols=false -p:PublishSingleFile=true -p:CIBuild=true | |
| - name: Build pkg installer | |
| run: | | |
| mkdir "install/macos/Serial Loops.app" | |
| cp -r "src/SerialLoops/bin/Release/net8.0/${{ matrix.type.rid }}/publish/Serial Loops.app" "install/macos/" | |
| cd install/macos/ | |
| chmod +x "./Serial Loops.app/Contents/MacOS/SerialLoops" | |
| python serial_loops_pkg_builder.py $SLVersion ${{ matrix.type.rid }} | |
| - name: Upload pkg installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.type.rid }}-installer | |
| path: install/macos/SerialLoops-${{ matrix.type.rid }}.pkg | |
| retention-days: 1 | |
| windows: | |
| # needs: check-new-commits | |
| # if: ${{ github.env.NEW_COMMIT_COUNT > 0 }} | |
| runs-on: windows-latest | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4.1.0 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Build & Publish Serial Loops | |
| shell: pwsh | |
| run: | | |
| dotnet publish src/SerialLoops/SerialLoops.csproj -c Release -f net8.0-windows -r win-x64 --self-contained /p:DebugType=None /p:DebugSymbols=false /p:PublishSingleFile=true | |
| Compress-Archive -Path src/SerialLoops/bin/Release/net8.0-windows/win-x64/publish/ -DestinationPath src/SerialLoops/bin/Release/net8.0-windows/win-x64/SerialLoops-winx64.zip | |
| - name: Upload Windows zip | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-x64-zip | |
| path: src/SerialLoops/bin/Release/net8.0-windows/win-x64/SerialLoops-winx64.zip | |
| retention-days: 1 | |
| - name: Download ISCC, Docker Desktop Installer, and devkitPro Updater | |
| shell: pwsh | |
| run: | | |
| ((Get-Content -Path install\windows\serial-loops.iss) -replace '#VERSION#', "$env:SLVersion") | Set-Content -Path install\windows\serial-loops.iss | |
| Start-BitsTransfer -Source https://haroohie.nyc3.cdn.digitaloceanspaces.com/bootstrap/serial-loops/iscc.zip -Destination install\windows\iscc.zip | |
| Expand-Archive -Path install\windows\iscc.zip -DestinationPath install\windows\ | |
| Start-BitsTransfer -Source https://github.com/devkitPro/installer/releases/download/v3.0.3/devkitProUpdater-3.0.3.exe -Destination install\windows\devkitProUpdater-3.0.3.exe | |
| Start-BitsTransfer -Source https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe -Destination "install\windows\Docker Desktop Installer.exe" | |
| - name: Compile Windows installer | |
| run: install\windows\iscc\ISCC.exe .\install\windows\serial-loops.iss | |
| - name: Upload Windows installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-x64-installer | |
| path: install/windows/Output/SerialLoopsInstaller.exe | |
| retention-days: 1 | |
| release: | |
| # if: ${{ github.env.NEW_COMMIT_COUNT != '0' }} | |
| runs-on: ubuntu-latest | |
| needs: [ linux-flatpak, linux-appimage, linux-dpkg-tarball, linux-rpm, macos-pkg, windows ] | |
| steps: | |
| - name: Download Linux flatpak | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: linux-x64-flatpak | |
| - name: Download Linux AppImage | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: linux-x64-appimage | |
| - name: Download Linux tarball | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: linux-x64-tarball | |
| - name: Download Linux dpkg | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: linux-x64-dpkg | |
| - name: Download Linux rpm | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: linux-x64-rpm | |
| - name: Download Apple Silicon macOS installer | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: osx-arm64-installer | |
| - name: Download Intel macOS installer | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: osx-x64-installer | |
| - name: Download Windows installer | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: windows-x64-installer | |
| - name: Download Windows portable zip | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: windows-x64-zip | |
| - name: Move and rename artifacts | |
| shell: pwsh | |
| run: | | |
| New-Item -Type Directory -Path release | |
| Get-ChildItem . | |
| Move-Item -Path SerialLoops.flatpak -Destination release/SerialLoops-linux-x64-v$($env:SLVersion).flatpak | |
| Move-Item -Path SerialLoops.AppImage -Destination release/SerialLoops-linux-x64-v$($env:SLVersion).AppImage | |
| Move-Item -Path SerialLoops.tar.gz -Destination release/SerialLoops-linux-x64-v$($env:SLVersion).tar.gz | |
| Move-Item -Path SerialLoops.deb -Destination release/SerialLoops-linux-x64-$($env:SLVersion).deb | |
| Move-Item -Path SerialLoops.rpm -Destination release/SerialLoops-linux-x64-$($env:SLVersion)-1.fc39.x86_64.rpm | |
| Move-Item -Path SerialLoops-osx-arm64.pkg -Destination release/SerialLoops-macOS-arm-v$($env:SLVersion)-installer.pkg | |
| Move-Item -Path SerialLoops-osx-x64.pkg -Destination release/SerialLoops-macOS-x64-v$($env:SLVersion)-installer.pkg | |
| Move-Item -Path SerialLoopsInstaller.exe -Destination release/SerialLoops-windows-x64-v$($env:SLVersion)-installer.exe | |
| Move-Item -Path SerialLoops-winx64.zip -Destination release/SerialLoops-windows-x64-v$($env:SLVersion)-portable.zip | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Serial Loops v${{ env.SLVersion }} | |
| tag_name: ${{ env.SLVersion }} | |
| prerelease: ${{ inputs.version == '' }} | |
| generate_release_notes: true | |
| files: release/* | |
| body: | | |
| ${{ inputs.releaseNotes }} | |
| ## Installation Notes | |
| To test the game you will need to have a Nintendo DS emulator installed. We recommend [melonDS](https://melonds.kuribo64.net/) for its accuracy. | |
| Because our application contacts GitHub's servers to check for new releases on launch, it is possible it will get flagged by firewall software – please allow it through so it can function correctly. | |
| ### Windows | |
| Simply download the Windows installer application and run it. It will walk you through installation, including installing the necessary dependencies. Specifically, it will run the **devkitPro** installer, the **Docker Desktop** installer, and the **Windows Subsystem for Linux (WSL)** installer. | |
| * For the devkitPro installer, you can select "Remove Downloaded Files" and uncheck all components except the "NDS Development". It will pop several terminal windows as it installs the necessary components; this is normal, so don't worry! | |
| * The WSL installer will run automatically. It may pop a window afterwards with more information about WSL; you can close this without reading it as it is not relevant for the project. | |
| * The Docker Desktop installer will take a little while to run and afterwards ask you to restart to finish the installation process. You can close the Serial Loops installer once it is finished and then restart your system. | |
| Alternatively, you can download the zip file for a portable application; however, dependencies are not included with this option. | |
| ### macOS | |
| Pick the macOS pkg installer that fits your computer's architecture. Before executing it, you will need to open the Terminal application and run `xattr -cr ~/Downloads/SerialLoops-macOS-arm-v${{ env.SLVersion }}-installer.pkg` for the ARM installer and `xattr -cr ~/Downloads/SerialLoops-macOS-x64-v${{ env.SLVersion }}-installer.pkg` for the x64 installer. This is required because we currently don't codesign the installer, meaning macOS will refuse to run it without explicit approval from you. | |
| The pkg installer will guide you through installing Serial Loops and will automatically install the dependencies devkitARM and make if necessary. Note that in order to install make we install xcode-tools—this installation can take a long time, so please be patient! | |
| #### Which macOS pkg installer should I choose? | |
| If your Mac is newer, you will probably want the ARM installer. If it is older, you may want the x64 one. To make sure, go to Settings → About and check your chip. If it is an Intel, you want the x64 installer. If it is an Apple chip, you want the ARM installer. | |
| The first time you install Serial Loops, this process can take several minutes, so please be patient! | |
| ### Linux | |
| We recommend using the provided Flatpak as it is the easiest to use. First, install [Flatpak](https://flatpak.org/setup/) if you haven't already. Then, download the Serial Loops Flatpak artifact and double click it or run `flatpak install` on it from the terminal. It will then install itself, bringing all the necessary dependencies with it. | |
| You can also install the official [melonDS Flatpak from Flathub](https://flathub.org/apps/net.kuribo64.melonDS) to use as your emulator. We recommend installing it from the [flathub-beta](https://docs.flathub.org/docs/for-users/installation/#flathub-beta-repository) repository as that is where the most up-to-date versions tend to be pushed. | |
| The main benefit of the Flatpak is that it is packaged with devkitARM for ease of use. However, if you already have devkitARM installed or would like to use something more lightweight, we also provide the following options (all of which require [installing devkitARM yourself](https://devkitpro.org/wiki/Getting_Started)): | |
| * The AppImage is designed to run on all Linux distros and is an easy, click-once option. | |
| * The `.deb` package is intended for Debian-based distros (e.g. Ubuntu). Install it with `sudo apt install -f ./SerialLoops-linux-x64-${{ env.SLVersion }}.deb`. | |
| * The `.rpm` package is intended for Red Hat distros (e.g. Fedora). Install it with `sudo dnf install ./SerialLoops-linux-x64-${{ env.SLVersion }}-1.fc39.x86_64.rpm`. | |
| * You may also opt to simply use the binaries packaged in the `.tar.gz` archive; when doing so, ensure you install the SDL2 binaries so audio playback works. |