Build #4
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 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version to build (e.g., 1.0.0)" | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| platform: mac | |
| - os: windows-latest | |
| platform: win | |
| - os: ubuntu-latest | |
| platform: linux | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build app | |
| run: npm run build | |
| # macOS: Build for both architectures | |
| - name: Build Electron (macOS) | |
| if: matrix.platform == 'mac' | |
| run: npm run electron:build:mac -- --x64 --arm64 | |
| # Windows: Build for x64 and arm64 | |
| - name: Build Electron (Windows) | |
| if: matrix.platform == 'win' | |
| run: npm run electron:build:win -- --x64 --arm64 | |
| # Linux: Build for x64 and arm64 | |
| - name: Build Electron (Linux) | |
| if: matrix.platform == 'linux' | |
| run: npm run electron:build:linux -- --x64 --arm64 | |
| # Upload artifacts to release | |
| - name: Upload to Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ inputs.version }} | |
| files: | | |
| dist-electron/*.dmg | |
| dist-electron/*.zip | |
| dist-electron/*.exe | |
| dist-electron/*.AppImage | |
| dist-electron/*.deb | |
| dist-electron/*.rpm | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Upload artifacts as workflow artifacts (backup) | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-${{ matrix.platform }} | |
| path: | | |
| dist-electron/*.dmg | |
| dist-electron/*.zip | |
| dist-electron/*.exe | |
| dist-electron/*.AppImage | |
| dist-electron/*.deb | |
| dist-electron/*.rpm | |
| retention-days: 7 |