Windows, how does it work? #38
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-app | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG_NAME: ${{ github.ref_name }} | |
| run: | | |
| gh release view "${TAG_NAME}" >/dev/null 2>&1 \ | |
| || gh release create "${TAG_NAME}" --generate-notes --title "${TAG_NAME}" --verify-tag | |
| build-linux: | |
| needs: create-release | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 24 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Install Dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y fakeroot rpm | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| id: pnpm-install | |
| with: | |
| run_install: false | |
| - name: Cache Electron Downloads | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ runner.temp }}/electron-cache | |
| key: ${{ runner.os }}-electron-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-electron- | |
| - name: Install Node Dependencies | |
| run: pnpm install | |
| - name: Build Renderer | |
| run: pnpm exec vp build | |
| - name: Build Linux App | |
| timeout-minutes: 45 | |
| env: | |
| DEBUG: electron-forge:*,electron-packager,@electron/get:* | |
| ELECTRON_CACHE: ${{ runner.temp }}/electron-cache | |
| run: | | |
| rm -rf ./out | |
| pnpm exec electron-forge make --platform=linux --arch=x64 | |
| test -d ./out | |
| - name: Attach Linux App to Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG_NAME: ${{ github.ref_name }} | |
| run: | | |
| shopt -s nullglob | |
| assets=( | |
| out/make/deb/x64/*.deb | |
| out/make/rpm/x64/*.rpm | |
| ) | |
| if [ "${#assets[@]}" -eq 0 ]; then | |
| echo "No Linux release assets found." | |
| find out -type f | |
| exit 1 | |
| fi | |
| gh release upload "${TAG_NAME}" "${assets[@]}" --clobber | |
| build-windows: | |
| needs: create-release | |
| runs-on: windows-2022 | |
| timeout-minutes: 60 | |
| env: | |
| CODIFF_SKIP_SQUIRREL: '1' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 24 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| id: pnpm-install | |
| with: | |
| run_install: false | |
| - name: Cache Electron Downloads | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ runner.temp }}/electron-cache | |
| key: ${{ runner.os }}-electron-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-electron- | |
| - name: Install Node Dependencies | |
| run: pnpm install | |
| - name: Build Renderer | |
| run: pnpm exec vp build | |
| - name: Build Windows App | |
| timeout-minutes: 45 | |
| env: | |
| DEBUG: electron-forge:*,electron-packager,@electron/get:* | |
| ELECTRON_CACHE: ${{ runner.temp }}/electron-cache | |
| run: | | |
| if (Test-Path out) { | |
| Remove-Item -Recurse -Force out | |
| } | |
| pnpm exec electron-forge make --platform=win32 --arch=x64 | |
| if (!(Test-Path out)) { | |
| throw 'The out directory was not created.' | |
| } | |
| - name: Attach Windows App to Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG_NAME: ${{ github.ref_name }} | |
| run: | | |
| $assets = @(Get-ChildItem -Path out/make/zip/win32/x64/*.zip -ErrorAction SilentlyContinue) | |
| if ($assets.Count -eq 0) { | |
| Write-Error 'No Windows release assets found.' | |
| Get-ChildItem -Path out -Recurse -File | ForEach-Object { $_.FullName } | |
| exit 1 | |
| } | |
| $assetPaths = $assets | ForEach-Object { $_.FullName } | |
| gh release upload $env:TAG_NAME @assetPaths --clobber |