fix: correct win-unpacked path to include version directory #10
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 & Release Meridia | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-windows: | |
| name: Build (Windows) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Compile TypeScript + Vite | |
| run: npx tsc && npx vite build | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Package Electron app (unpacked) | |
| run: npx electron-builder --win dir | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create placeholder icon if missing | |
| shell: powershell | |
| run: | | |
| if (!(Test-Path "build\icon.ico")) { | |
| New-Item -ItemType Directory -Force -Path build | Out-Null | |
| Invoke-WebRequest -Uri "https://raw.githubusercontent.com/electron/electron/main/shell/browser/resources/win/electron.ico" -OutFile "build\icon.ico" | |
| } | |
| - name: Create placeholder sidebar image if missing | |
| shell: powershell | |
| run: | | |
| if (!(Test-Path "build\installer-sidebar.bmp")) { | |
| New-Item -ItemType Directory -Force -Path build | Out-Null | |
| Add-Type -AssemblyName System.Drawing | |
| $bmp = [System.Drawing.Bitmap]::new(164, 314) | |
| $g = [System.Drawing.Graphics]::FromImage($bmp) | |
| $g.Clear([System.Drawing.Color]::FromArgb(30, 30, 30)) | |
| $g.Dispose() | |
| $bmp.Save("build\installer-sidebar.bmp") | |
| $bmp.Dispose() | |
| } | |
| continue-on-error: true | |
| - name: Compile Inno Setup installer | |
| shell: powershell | |
| run: | | |
| $version = "${{ github.ref_name }}".TrimStart("v") | |
| $iss = Get-Content installer.iss -Raw | |
| $iss = $iss -replace '#define MyAppVersion ".*"', "#define MyAppVersion `"$version`"" | |
| $iss = $iss -replace 'release\\{#MyAppVersion}\\win-unpacked', "release\$version\win-unpacked" | |
| $iss | Set-Content installer.iss | |
| & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" installer.iss | |
| - name: Upload Windows artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-build | |
| path: release/inno/*-Setup.exe | |
| if-no-files-found: error | |
| build-linux: | |
| name: Build (Linux) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install Linux build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libgtk-3-dev \ | |
| libwebkit2gtk-4.1-dev \ | |
| libayatana-appindicator3-dev \ | |
| librsvg2-dev \ | |
| patchelf \ | |
| fuse \ | |
| libfuse2 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build Electron app (Linux) | |
| run: npm run build | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Linux artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-build | |
| path: release/**/*.AppImage | |
| if-no-files-found: error | |
| release: | |
| name: Publish Release | |
| needs: [build-windows, build-linux] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Windows artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: windows-build | |
| path: artifacts/windows | |
| - name: Download Linux artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: linux-build | |
| path: artifacts/linux | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: "Meridia ${{ github.ref_name }}" | |
| tag_name: ${{ github.ref_name }} | |
| draft: false | |
| prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }} | |
| generate_release_notes: true | |
| files: | | |
| artifacts/windows/**/* | |
| artifacts/linux/**/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |