|
| 1 | +name: Build Electron App |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + paths: |
| 8 | + - 'apps/webapp/**' |
| 9 | + - '.github/workflows/electron-build.yml' |
| 10 | + pull_request: |
| 11 | + paths: |
| 12 | + - 'apps/webapp/**' |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + name: Build on ${{ matrix.os }} |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + os: [macos-latest, ubuntu-latest, windows-latest] |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout code |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Setup Bun |
| 29 | + uses: oven-sh/setup-bun@v2 |
| 30 | + with: |
| 31 | + bun-version: latest |
| 32 | + |
| 33 | + - name: Install dependencies |
| 34 | + working-directory: apps/webapp |
| 35 | + run: bun install --frozen-lockfile |
| 36 | + |
| 37 | + - name: Build Electron app |
| 38 | + working-directory: apps/webapp |
| 39 | + run: bun run make |
| 40 | + env: |
| 41 | + NODE_ENV: production |
| 42 | + APPLE_ID: ${{ secrets.APPLE_ID }} |
| 43 | + APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} |
| 44 | + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} |
| 45 | + APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} |
| 46 | + APP_BUNDLE_ID: ${{ secrets.APP_BUNDLE_ID }} |
| 47 | + |
| 48 | + # - name: Import Apple cert |
| 49 | + # if: matrix.os == 'macos-latest' |
| 50 | + # run: | |
| 51 | + # echo "$APPLE_CERT_P12" | base64 --decode > /tmp/cert.p12 |
| 52 | + # security create-keychain -p "$KEYCHAIN_PASS" build.keychain |
| 53 | + # security default-keychain -s build.keychain |
| 54 | + # security unlock-keychain -p "$KEYCHAIN_PASS" build.keychain |
| 55 | + # security import /tmp/cert.p12 -k build.keychain -P "$APPLE_CERT_PASSWORD" -T /usr/bin/codesign |
| 56 | + # security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASS" build.keychain |
| 57 | + # env: |
| 58 | + # APPLE_CERT_P12: ${{ secrets.APPLE_CERT_P12 }} |
| 59 | + # APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }} |
| 60 | + # KEYCHAIN_PASS: ${{ secrets.APPLE_CERT_PASSWORD }} |
| 61 | + |
| 62 | + - name: Upload artifacts (macOS) |
| 63 | + if: matrix.os == 'macos-latest' |
| 64 | + uses: actions/upload-artifact@v4 |
| 65 | + with: |
| 66 | + name: xyd-macos |
| 67 | + path: | |
| 68 | + apps/webapp/out/make/**/*.dmg |
| 69 | + apps/webapp/out/make/**/*.zip |
| 70 | + if-no-files-found: warn |
| 71 | + |
| 72 | + - name: Upload artifacts (Linux) |
| 73 | + if: matrix.os == 'ubuntu-latest' |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: xyd-linux |
| 77 | + path: | |
| 78 | + apps/webapp/out/make/**/*.deb |
| 79 | + apps/webapp/out/make/**/*.rpm |
| 80 | + if-no-files-found: warn |
| 81 | + |
| 82 | + - name: Upload artifacts (Windows) |
| 83 | + if: matrix.os == 'windows-latest' |
| 84 | + uses: actions/upload-artifact@v4 |
| 85 | + with: |
| 86 | + name: xyd-windows |
| 87 | + path: | |
| 88 | + apps/webapp/out/make/**/*.exe |
| 89 | + apps/webapp/out/make/**/*.msi |
| 90 | + if-no-files-found: warn |
0 commit comments