Build Desktop Applications #7
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 Desktop Applications | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| workflow_dispatch: | |
| inputs: | |
| publish: | |
| description: 'Publish to GitHub Releases' | |
| required: false | |
| default: 'false' | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| platform: linux | |
| - os: macos-latest | |
| platform: mac | |
| - os: windows-latest | |
| platform: windows | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build main application | |
| run: npm run build | |
| - name: Install icon builder (Ubuntu/macOS) | |
| if: runner.os != 'Windows' | |
| run: npm install -g electron-icon-builder | |
| - name: Install icon builder (Windows) | |
| if: runner.os == 'Windows' | |
| run: npm install -g electron-icon-builder | |
| shell: powershell | |
| - name: Generate icons | |
| run: | | |
| cd electron/build | |
| electron-icon-builder --input=../../LiaScript/resources/icon.png --output=. | |
| shell: bash | |
| - name: Build Electron app (Linux) | |
| if: matrix.platform == 'linux' | |
| run: npm run electron:build:linux | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Electron app (macOS) | |
| if: matrix.platform == 'mac' | |
| run: npm run electron:build:mac | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # For code signing (optional): | |
| # CSC_LINK: ${{ secrets.MAC_CERT }} | |
| # CSC_KEY_PASSWORD: ${{ secrets.MAC_CERT_PASSWORD }} | |
| # APPLE_ID: ${{ secrets.APPLE_ID }} | |
| # APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} | |
| - name: Build Electron app (Windows) | |
| if: matrix.platform == 'windows' | |
| run: npm run electron:build:win | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # For code signing (optional): | |
| # CSC_LINK: ${{ secrets.WIN_CERT }} | |
| # CSC_KEY_PASSWORD: ${{ secrets.WIN_CERT_PASSWORD }} | |
| - name: List build artifacts | |
| run: ls -R release/ | |
| shell: bash | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform }}-builds | |
| path: | | |
| release/*.exe | |
| release/*.zip | |
| release/*.dmg | |
| release/*.AppImage | |
| release/*.deb | |
| release/*.rpm | |
| release/*.tar.gz | |
| release/*.yml | |
| retention-days: 30 | |
| - name: Upload to Release (on tag) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| release/*.exe | |
| release/*.zip | |
| release/*.dmg | |
| release/*.AppImage | |
| release/*.deb | |
| release/*.rpm | |
| release/*.tar.gz | |
| release/*.yml | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Summary job | |
| build-summary: | |
| name: Build Summary | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Check build status | |
| run: | | |
| echo "Build completed!" | |
| echo "Linux: ${{ needs.build.result }}" | |
| echo "macOS: ${{ needs.build.result }}" | |
| echo "Windows: ${{ needs.build.result }}" |