|
| 1 | +name: build-electron-app |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: write |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + pull_request: |
| 11 | + branches: |
| 12 | + - master |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +env: |
| 16 | + DOCKER_BUILDKIT: 1 |
| 17 | + COMPOSE_DOCKER_CLI_BUILD: 1 |
| 18 | + |
| 19 | +jobs: |
| 20 | + linux-win-docker-builder: |
| 21 | + timeout-minutes: 90 |
| 22 | + runs-on: ubuntu-20.04 |
| 23 | + steps: |
| 24 | + - name: Checkout |
| 25 | + uses: actions/checkout@v3 |
| 26 | + with: |
| 27 | + submodules: recursive |
| 28 | + - name: Cache Docker images |
| 29 | + uses: ScribeMD/docker-cache@0.1.4 |
| 30 | + env: |
| 31 | + cache-name: docker-images-cache-v1 |
| 32 | + with: |
| 33 | + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Dockerfile**', 'docker-compose.yaml') }} |
| 34 | + - name: Cache Electron binaries |
| 35 | + id: electron-cache |
| 36 | + uses: actions/cache@v3 |
| 37 | + env: |
| 38 | + cache-name: electron-cache-v1 |
| 39 | + with: |
| 40 | + path: | |
| 41 | + ~/.cache/electron |
| 42 | + ~/.cache/electron-builder |
| 43 | + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }} |
| 44 | + restore-keys: | |
| 45 | + ${{ runner.os }}-build-${{ env.cache-name }}- |
| 46 | + - name: Build release |
| 47 | + id: release-builder |
| 48 | + uses: nick-fields/retry@v2 |
| 49 | + continue-on-error: false |
| 50 | + env: |
| 51 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + with: |
| 53 | + timeout_minutes: 20 |
| 54 | + retry_wait_seconds: 10 |
| 55 | + max_attempts: 3 |
| 56 | + retry_on: any |
| 57 | + command: ./scripts/launch.sh -lwp |
| 58 | + - name: Prepare cache folders |
| 59 | + run: | |
| 60 | + sudo chown -R $(id -u):$(id -g) ~/.cache/electron |
| 61 | + sudo chown -R $(id -u):$(id -g) ~/.cache/electron-builder |
| 62 | +
|
| 63 | + mac-builder: |
| 64 | + timeout-minutes: 90 |
| 65 | + runs-on: macos-11 |
| 66 | + steps: |
| 67 | + - name: Checkout |
| 68 | + uses: actions/checkout@v3 |
| 69 | + with: |
| 70 | + submodules: recursive |
| 71 | + - uses: actions/setup-node@v3 |
| 72 | + with: |
| 73 | + node-version: 14.16.0 |
| 74 | + - name: Cache Electron binaries |
| 75 | + id: electron-cache |
| 76 | + uses: actions/cache@v3 |
| 77 | + env: |
| 78 | + cache-name: electron-cache-v1 |
| 79 | + with: |
| 80 | + path: | |
| 81 | + ~/Library/Caches/electron |
| 82 | + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }} |
| 83 | + restore-keys: | |
| 84 | + ${{ runner.os }}-build-${{ env.cache-name }}- |
| 85 | + - name: Build release |
| 86 | + id: release-builder |
| 87 | + uses: nick-fields/retry@v2 |
| 88 | + continue-on-error: false |
| 89 | + env: |
| 90 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 91 | + ELECTRON_CACHE: ~/Library/Caches/electron |
| 92 | + with: |
| 93 | + timeout_minutes: 20 |
| 94 | + retry_wait_seconds: 10 |
| 95 | + max_attempts: 3 |
| 96 | + retry_on: any |
| 97 | + command: ./scripts/build-release.sh -mp |
0 commit comments