Cross-Platform Electron Build #18
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: Cross-Platform Electron Build | |
| on: | |
| workflow_call: | |
| repository_dispatch: | |
| types: [trigger-electron-build] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag to build for (e.g., v1.2.3)' | |
| required: true | |
| default: 'v' | |
| jobs: | |
| build-macos: | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| arch: [x64, arm64] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "yarn" | |
| - name: Force Git to use HTTPS instead of SSH | |
| run: | | |
| git config --global url."https://github.com/".insteadOf "git@github.com:" | |
| git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Build for macOS (${{ matrix.arch }}) | |
| run: yarn make --arch=${{ matrix.arch }} | |
| - name: Upload artifact to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.event.client_payload.tag || github.event.inputs.tag }} | |
| files: | | |
| out/make/**/*.zip | |
| out/make/**/*.dmg | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "yarn" | |
| - name: Force Git to use HTTPS instead of SSH | |
| run: | | |
| git config --global url."https://github.com/".insteadOf "git@github.com:" | |
| git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Build for Linux | |
| run: yarn make | |
| - name: Upload artifact to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.event.client_payload.tag || github.event.inputs.tag }} | |
| files: | | |
| out/make/**/*.AppImage | |
| out/make/**/*.deb | |
| out/make/**/*.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "yarn" | |
| - name: Force Git to use HTTPS instead of SSH | |
| run: | | |
| git config --global url."https://github.com/".insteadOf "git@github.com:" | |
| git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" | |
| - name: Install dependencies with retry # Retry logic for Windows because of network issues | |
| shell: bash | |
| run: | | |
| for i in 1 2 3; do | |
| yarn install --frozen-lockfile && break || sleep 10 | |
| done | |
| - name: Build for Windows | |
| run: yarn make | |
| - name: Upload artifact to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.event.client_payload.tag || github.event.inputs.tag }} | |
| files: | | |
| out/make/**/*.exe | |
| out/make/**/*.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |