Bump Avalonia and Avalonia.Desktop #127
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: Build BabySmash | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| branches: | |
| - '**' | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v4 | |
| with: | |
| versionSpec: '6.4.x' | |
| - name: GitVersion | |
| uses: gittools/actions/gitversion/execute@v4 | |
| id: gitversion | |
| - name: Set version environment variable | |
| run: | | |
| VERSION="${{ steps.gitversion.outputs.semVer }}" | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| echo "Using version: $VERSION" | |
| - name: Restore dependencies | |
| run: dotnet restore BabySmash.Linux/BabySmash.Linux.csproj | |
| - name: Build | |
| run: dotnet build BabySmash.Linux/BabySmash.Linux.csproj -c Release --no-restore | |
| - name: Publish Linux x64 | |
| run: | | |
| dotnet publish BabySmash.Linux/BabySmash.Linux.csproj \ | |
| -c Release \ | |
| -r linux-x64 \ | |
| -p:DebugType=None \ | |
| -p:DebugSymbols=false \ | |
| -p:PublishSingleFile=true \ | |
| --self-contained | |
| - name: Install nfpm | |
| run: | | |
| echo "Installing nfpm..." | |
| go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest | |
| echo "$HOME/go/bin" >> $GITHUB_PATH | |
| - name: Verify nfpm installation | |
| run: nfpm --version | |
| - name: Create .deb package | |
| run: | | |
| mkdir -p artifacts | |
| nfpm package --packager deb --target artifacts/ | |
| env: | |
| VERSION: ${{ steps.gitversion.outputs.semVer }} | |
| - name: Create .rpm package | |
| run: | | |
| nfpm package --packager rpm --target artifacts/ | |
| env: | |
| VERSION: ${{ steps.gitversion.outputs.semVer }} | |
| - name: Prepare Linux tarball | |
| run: | | |
| # Also create tarball for users who prefer it | |
| mkdir -p temp-linux | |
| cp BabySmash.Linux/bin/Release/net10.0/linux-x64/publish/BabySmash.Linux temp-linux/babysmash | |
| cp BabySmash.Linux/babysmash.desktop temp-linux/ | |
| cp Shared/Resources/babysmash.png temp-linux/ | |
| cp README.md temp-linux/ | |
| chmod +x temp-linux/babysmash | |
| tar -czvf artifacts/BabySmash-linux-x64.tar.gz -C temp-linux . | |
| rm -rf temp-linux | |
| - name: Upload Linux artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: BabySmash-Linux | |
| path: artifacts/* | |
| build-windows: | |
| runs-on: windows-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore BabySmash.csproj | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v4 | |
| with: | |
| versionSpec: '6.4.x' | |
| - name: GitVersion | |
| uses: gittools/actions/gitversion/execute@v4 | |
| id: gitversion | |
| - name: Set version environment variables | |
| shell: pwsh | |
| run: | | |
| $version = '${{ steps.gitversion.outputs.semVer }}' | |
| $fullVersion = '${{ steps.gitversion.outputs.fullSemVer }}' | |
| $assemblyVersion = "${{ steps.gitversion.outputs.major }}.${{ steps.gitversion.outputs.minor }}.${{ steps.gitversion.outputs.patch }}.0" | |
| Write-Host "SemVer: $version" | |
| Write-Host "FullSemVer: $fullVersion" | |
| Write-Host "AssemblyVersion: $assemblyVersion" | |
| echo "VERSION=$version" >> $env:GITHUB_ENV | |
| echo "FULLVERSION=$fullVersion" >> $env:GITHUB_ENV | |
| echo "ASSEMBLY_VERSION=$assemblyVersion" >> $env:GITHUB_ENV | |
| - name: Build | |
| run: dotnet build BabySmash.csproj -c Release --no-restore | |
| - name: Publish x64 | |
| run: | | |
| dotnet publish BabySmash.csproj ` | |
| -c Release ` | |
| -r win-x64 ` | |
| /p:DebugType=None ` | |
| /p:DebugSymbols=false ` | |
| /p:Version=$env:VERSION ` | |
| /p:AssemblyVersion=$env:ASSEMBLY_VERSION ` | |
| /p:FileVersion=$env:ASSEMBLY_VERSION ` | |
| /p:AssemblyInformationalVersion=$env:FULLVERSION ` | |
| --self-contained | |
| - name: Azure Login | |
| uses: azure/login@v2 | |
| with: | |
| creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}' | |
| - name: Sign executable with Trusted Signing | |
| uses: azure/trusted-signing-action@v1 | |
| with: | |
| azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
| azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
| azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| endpoint: https://wus2.codesigning.azure.net/ | |
| signing-account-name: hanselman | |
| certificate-profile-name: WindowsEdgeLight | |
| files-folder: ${{ github.workspace }}\bin\Release\net10.0-windows\win-x64\publish | |
| files-folder-filter: exe | |
| file-digest: SHA256 | |
| timestamp-rfc3161: http://timestamp.acs.microsoft.com | |
| timestamp-digest: SHA256 | |
| - name: Install Inno Setup | |
| shell: pwsh | |
| run: | | |
| choco install innosetup -y --no-progress | |
| echo "C:\Program Files (x86)\Inno Setup 6" >> $env:GITHUB_PATH | |
| - name: Build Installer | |
| shell: pwsh | |
| run: | | |
| # Copy signed exe to publish folder for installer | |
| New-Item -ItemType Directory -Path publish -Force | |
| Copy-Item "bin/Release/net10.0-windows/win-x64/publish/BabySmash.exe" -Destination "publish/" | |
| # Compile installer with version | |
| iscc "/DMyAppVersion=$env:VERSION" installer.iss | |
| - name: Sign Installer with Trusted Signing | |
| uses: azure/trusted-signing-action@v1 | |
| with: | |
| azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
| azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
| azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| endpoint: https://wus2.codesigning.azure.net/ | |
| signing-account-name: hanselman | |
| certificate-profile-name: WindowsEdgeLight | |
| files-folder: ${{ github.workspace }}\Output | |
| files-folder-filter: exe | |
| file-digest: SHA256 | |
| timestamp-rfc3161: http://timestamp.acs.microsoft.com | |
| timestamp-digest: SHA256 | |
| - name: Prepare artifacts | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Path artifacts -Force | |
| $version = $env:VERSION | |
| # Copy installer with consistent name (for direct download links) | |
| Copy-Item "Output/BabySmash-Setup.exe" -Destination "artifacts/BabySmash-Setup.exe" | |
| # Create portable ZIP with exe and README | |
| # Updatum looks for "win-x64" in asset name by default (AssetRegexPattern) | |
| New-Item -ItemType Directory -Path "temp-x64" -Force | |
| Copy-Item "bin/Release/net10.0-windows/win-x64/publish/BabySmash.exe" -Destination "temp-x64/" | |
| Copy-Item "README.md" -Destination "temp-x64/" | |
| Compress-Archive -Path "temp-x64/*" -DestinationPath "artifacts/BabySmash-win-x64.zip" | |
| Remove-Item "temp-x64" -Recurse -Force | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: BabySmash-Windows | |
| path: artifacts/* | |
| create-release: | |
| runs-on: ubuntu-latest | |
| needs: [build-linux, build-windows] | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download Linux artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: BabySmash-Linux | |
| path: artifacts/ | |
| - name: Download Windows artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: BabySmash-Windows | |
| path: artifacts/ | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/* | |
| generate_release_notes: true | |
| body: | | |
| ## BabySmash! ${{ github.ref_name }} | |
| A game for babies who like to bang on the keyboard! | |
| ### 📦 Download | |
| | File | Description | | |
| |------|-------------| | |
| | `BabySmash-Setup.exe` | **Windows** - Installer with Start Menu shortcut | | |
| | `BabySmash-win-x64.zip` | **Windows** - Portable version (also used by auto-updater) | | |
| | `babysmash_*_amd64.deb` | **Debian/Ubuntu** - Install with `sudo dpkg -i babysmash_*_amd64.deb` | | |
| | `babysmash-*.x86_64.rpm` | **Fedora/RHEL** - Install with `sudo rpm -i babysmash-*.x86_64.rpm` | | |
| | `BabySmash-linux-x64.tar.gz` | **Linux** - Manual install, extract and run `./babysmash` | | |
| **Self-contained** - No .NET installation required. | |
| ### ⌨️ Usage | |
| - Press keys and watch shapes and letters appear! | |
| - `Alt+O` - Options (Linux) / `Ctrl+Shift+Alt+O` - Options (Windows) | |
| - `Escape` - Exit (Linux) / `Alt+F4` - Exit (Windows) | |
| ### 🐧 Linux Package Installation | |
| **Debian/Ubuntu:** | |
| ```bash | |
| sudo dpkg -i babysmash_*_amd64.deb | |
| sudo apt-get install -f # Install dependencies if needed | |
| ``` | |
| **Fedora/RHEL:** | |
| ```bash | |
| sudo rpm -i babysmash-*.x86_64.rpm | |
| ``` | |
| After installation, BabySmash will appear in your application menu! | |
| ### 🐧 Linux Dependencies | |
| - `espeak` for text-to-speech | |
| - `pulseaudio-utils` or `alsa-utils` for audio | |
| These are automatically installed when using .deb or .rpm packages. | |
| --- | |
| append_body: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |