Feature/automated installers #3
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: Build MarkAPI Installers | |
| "on": | |
| push: | |
| branches: [main, develop] | |
| paths: | |
| - 'distribution/**' | |
| - '.github/workflows/build-installers.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'distribution/**' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to build' | |
| required: false | |
| default: '1.0.0' | |
| env: | |
| APP_VERSION: ${{ github.event.inputs.version || '1.0.0' }} | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Inno Setup via Chocolatey | |
| run: | | |
| choco install innosetup -y | |
| shell: powershell | |
| - name: Create missing Windows files | |
| run: | | |
| mkdir -p distribution/windows/scripts | |
| mkdir -p distribution/windows/resources | |
| echo "Placeholder" > distribution/windows/resources/license.txt | |
| echo "Placeholder" > distribution/windows/resources/icon.ico | |
| shell: bash | |
| - name: Update version in setup script | |
| run: | | |
| if (Test-Path "distribution/windows/setup.iss") { | |
| $content = Get-Content "distribution/windows/setup.iss" | |
| $pattern = '#define MyAppVersion ".*"' | |
| $replacement = "#define MyAppVersion `"$env:APP_VERSION`"" | |
| $content = $content -replace $pattern, $replacement | |
| Set-Content "distribution/windows/setup.iss" $content | |
| } else { | |
| Write-Host "setup.iss not found, skipping" | |
| } | |
| shell: powershell | |
| - name: Build Windows installer | |
| run: | | |
| if (Test-Path "distribution/windows/setup.iss") { | |
| $inno = "C:\ProgramData\chocolatey\lib\innosetup\tools\ISCC.exe" | |
| if (Test-Path $inno) { | |
| & $inno "distribution/windows/setup.iss" | |
| } else { | |
| Write-Host "Inno Setup not found at expected location" | |
| Get-ChildItem "C:\ProgramData\chocolatey\lib\innosetup" -Recurse -Name "ISCC.exe" | |
| } | |
| } else { | |
| Write-Host "No setup.iss found, creating placeholder" | |
| mkdir -p distribution/windows/Output | |
| echo "Placeholder installer" > distribution/windows/Output/MarkAPI-Setup-$env:APP_VERSION.exe | |
| } | |
| shell: powershell | |
| - name: Upload Windows installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: markapi-windows-installer | |
| path: distribution/windows/Output/MarkAPI-Setup-*.exe | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential devscripts debhelper | |
| - name: Build DEB package | |
| run: | | |
| cd distribution/linux | |
| chmod +x build-deb.sh | |
| ./build-deb.sh ${{ env.APP_VERSION }} | |
| - name: Build AppImage | |
| run: | | |
| cd distribution/linux | |
| chmod +x build-appimage.sh | |
| ./build-appimage.sh ${{ env.APP_VERSION }} | |
| - name: Upload Linux packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: markapi-linux-packages | |
| path: | | |
| distribution/linux/dist/*.deb | |
| distribution/linux/dist/*.AppImage | |
| build-universal: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Create universal package | |
| run: | | |
| cd distribution/universal | |
| mkdir -p ../../dist | |
| tar czf "../../dist/markapi-universal-${{ env.APP_VERSION }}.tar.gz" . | |
| zip -r "../../dist/markapi-universal-${{ env.APP_VERSION }}.zip" . | |
| - name: Upload universal package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: markapi-universal-package | |
| path: dist/markapi-universal-* |