|
| 1 | +name: Build Executables |
| 2 | +run-name: "${{ github.ref_name }}" |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - "v*.*" |
| 8 | + - "v*.*.*" |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-windows: |
| 12 | + runs-on: ${{ matrix.runner }} |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + runner: [windows-latest] |
| 16 | + steps: |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v4 |
| 19 | + - name: Install dependencies |
| 20 | + run: | |
| 21 | + npm install |
| 22 | + npm install -g @ionic/cli |
| 23 | + cd "${env:GITHUB_WORKSPACE}\electron" |
| 24 | + npm install |
| 25 | + - name: Ionic production build |
| 26 | + run: | |
| 27 | + ionic build --prod |
| 28 | + - name: Capacitor copy to @capacitor-community/electron |
| 29 | + run: | |
| 30 | + npx cap copy @capacitor-community/electron |
| 31 | + - name: Build Capacitor Electron |
| 32 | + run: | |
| 33 | + cd "${env:GITHUB_WORKSPACE}\electron" |
| 34 | + npm run electron:make |
| 35 | + cd "${env:GITHUB_WORKSPACE}\electron\dist" |
| 36 | + dir |
| 37 | + - name: Upload built files |
| 38 | + uses: actions/upload-artifact@v4 |
| 39 | + with: |
| 40 | + name: ${{ matrix.runner }} |
| 41 | + path: | |
| 42 | + ${{ github.workspace }}/electron/dist/*.exe |
| 43 | + if-no-files-found: error |
| 44 | + |
| 45 | + build-linux: |
| 46 | + runs-on: ${{ matrix.runner }} |
| 47 | + strategy: |
| 48 | + matrix: |
| 49 | + runner: [ubuntu-latest] |
| 50 | + |
| 51 | + steps: |
| 52 | + - name: Checkout code |
| 53 | + uses: actions/checkout@v4 |
| 54 | + - name: Install depedencies |
| 55 | + run: | |
| 56 | + npm install |
| 57 | + npm install -g @ionic/cli |
| 58 | + cd '${{ github.workspace }}/electron' |
| 59 | + npm install |
| 60 | + - name: Ionic production build |
| 61 | + run: | |
| 62 | + ionic build --prod |
| 63 | + - name: Capacitor copy to @capacitor-community/electron |
| 64 | + run: | |
| 65 | + npx cap copy @capacitor-community/electron |
| 66 | + - name: Build Capacitor Electron |
| 67 | + run: | |
| 68 | + cd '${{ github.workspace }}/electron' |
| 69 | + npm run electron:make |
| 70 | + cd '${{ github.workspace }}/electron/dist' |
| 71 | + ls |
| 72 | + - name: Upload built files |
| 73 | + uses: actions/upload-artifact@v4 |
| 74 | + with: |
| 75 | + name: ${{ matrix.runner }} |
| 76 | + path: | |
| 77 | + ${{ github.workspace }}/electron/dist/*.AppImage |
| 78 | + ${{ github.workspace }}/electron/dist/*.deb |
| 79 | + if-no-files-found: error |
| 80 | + |
| 81 | + build-macos: |
| 82 | + runs-on: ${{ matrix.runner }} |
| 83 | + strategy: |
| 84 | + matrix: |
| 85 | + runner: [macos-latest] |
| 86 | + steps: |
| 87 | + - name: Checkout code |
| 88 | + uses: actions/checkout@v4 |
| 89 | + - name: Install depedencies |
| 90 | + run: | |
| 91 | + npm install |
| 92 | + npm install -g @ionic/cli |
| 93 | + cd '${{ github.workspace }}/electron' |
| 94 | + npm install |
| 95 | + - name: Ionic production build |
| 96 | + run: | |
| 97 | + ionic build --prod |
| 98 | + - name: Capacitor copy to @capacitor-community/electron |
| 99 | + run: | |
| 100 | + npx cap copy @capacitor-community/electron |
| 101 | + - name: Build Capacitor Electron |
| 102 | + run: | |
| 103 | + cd '${{ github.workspace }}/electron' |
| 104 | + npm run electron:make |
| 105 | + cd '${{ github.workspace }}/electron/dist' |
| 106 | + ls |
| 107 | + - name: Upload built files |
| 108 | + uses: actions/upload-artifact@v4 |
| 109 | + with: |
| 110 | + name: ${{ matrix.runner }} |
| 111 | + path: | |
| 112 | + ${{ github.workspace }}/electron/dist/*.pkg |
| 113 | + ${{ github.workspace }}/electron/dist/*.dmg |
| 114 | + if-no-files-found: error |
| 115 | + |
| 116 | + release: |
| 117 | + needs: [build-windows, build-linux, build-macos] |
| 118 | + if: ${{ always() && !failure() }} |
| 119 | + runs-on: ubuntu-latest |
| 120 | + steps: |
| 121 | + - name: Download all artifacts |
| 122 | + uses: actions/download-artifact@v4 |
| 123 | + with: |
| 124 | + path: ./artifacts |
| 125 | + |
| 126 | + - name: Release |
| 127 | + uses: softprops/action-gh-release@v2 |
| 128 | + with: |
| 129 | + files: ./artifacts/**/* |
| 130 | + |
| 131 | +permissions: |
| 132 | + contents: write |
| 133 | + |
0 commit comments