Skip to content

Official release build for Serial Loops #29

Official release build for Serial Loops

Official release build for Serial Loops #29

Workflow file for this run

name: Serial Loops Official Build
run-name: "Official release build for Serial Loops"
on:
# schedule:
# - cron: '0 23 * * *'
workflow_dispatch:
inputs:
version:
description: Release version
required: true
type: string
releaseNotes:
description: Release notes
required: true
type: string
env:
SLVersion: ${{ inputs.version == '' && format('0.3.pre.a{0}', github.run_number) || inputs.version }}
SLAssemblyVersion: ${{ inputs.version == '' && format('0.3.9999.a{0}', github.run_number) || inputs.version }}
jobs:
linux-flatpak-setup:
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/[email protected]
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
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/[email protected]
with:
name: nuget-sources
path: install/linux/flatpak/
- 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 }}
linux-dpkg-tarball:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/[email protected]
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-tar
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
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
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:
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
- name: Upload rpm
uses: actions/upload-artifact@v4
with:
name: linux-x64-rpm
path: install/linux/rpm/rpmbuild/RPMS/x86_64/SerialLoops-$(Version)-1.fc39.x86_64.rpm
retention-days: 1
macos-pkg:
runs-on: macos-latest
strategy:
matrix:
rid: ['osx-x64', 'osx-arm64']
steps:
- name: Check out
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/[email protected]
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: Restore
run: dotnet restore src/SerialLoops/SerialLoops.csproj -r ${{ matrix.rid }}
- name: Build .app
run: dotnet msbuild src/SerialLoops/SerialLoops.csproj -t:BundleApp -p:Configuration=Release -p:TargetFramework=net8.0 -p:RuntimeIdentifier=${{ matrix.rid }} -p:UseAppHost=true --p:SelfContained=true -p:DebugType=None -p:DebugSymbols=false -p:PublishSingleFile=true
- name: Build pkg installer
run: |
mkdir "install/macos/Serial Loops.app"
cp -r "src/SerialLoops/bin/Release/net8.0/${{ matrix.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
- name: Upload pkg installer
uses: actions/upload-artifact@v4
with:
name: macOS-${{ matrix.rid }}-installer
path: install/macos/SerialLoops.pkg
retention-days: 1
windows:
runs-on: windows-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: '8.0.x'
- name: Build & Publish Serial Loops
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
- name: Upload Windows zip
uses: actions/upload-artifact@v4
with:
name: windows-x64-zip
path: src/SerialLoops/bin/Release/net8.0-windows/win-x64/publish/
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#', '$(Version)') | 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