-
Notifications
You must be signed in to change notification settings - Fork 14
137 lines (132 loc) · 4.15 KB
/
build-electron-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Build release
run-name: 'Release version: Commit ${{ github.sha }}'
permissions:
contents: write
on:
push:
branches:
- master
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: false
isAutoUpdateDisabled:
description: 'Is auto-update disabled (true / 1)?'
required: false
isBfxApiStaging:
description: 'Is it necessary to use BFX API Staging? (true / 1)?'
required: false
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
jobs:
linux-win-docker-builder:
timeout-minutes: 90
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set repo owner
run: |
sed -i -e \
"s/owner: '.*'/owner: '${{ github.repository_owner }}'/g" \
"./electron-builder-config.js"
- if: github.event.inputs.version != ''
name: Set release version
run: |
sed -i -e \
"s/\"version\": \".*\"/\"version\": \"${{ github.event.inputs.version }}\"/g" \
"./package.json"
- if: contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isAutoUpdateDisabled)
name: Turn off auto-update
run: |
echo "IS_AUTO_UPDATE_DISABLED=1" >> $GITHUB_ENV
- if: contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isBfxApiStaging)
name: Use BFX API Staging for queries
run: |
echo "IS_BFX_API_STAGING=1" >> $GITHUB_ENV
- name: Cache Electron binaries
id: electron-cache
uses: actions/cache@v3
env:
cache-name: electron-cache-v1
with:
path: |
~/.cache/electron
~/.cache/electron-builder
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Build release
id: release-builder
uses: nick-fields/retry@v2
continue-on-error: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
timeout_minutes: 20
retry_wait_seconds: 10
max_attempts: 3
retry_on: any
command: ./scripts/launch.sh -lwp
- name: Prepare cache folders
run: |
sudo chown -R $(id -u):$(id -g) ~/.cache/electron
sudo chown -R $(id -u):$(id -g) ~/.cache/electron-builder
mac-builder:
timeout-minutes: 90
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set repo owner
run: |
sed -i -e \
"s/owner: '.*'/owner: '${{ github.repository_owner }}'/g" \
"./electron-builder-config.js"
- if: github.event.inputs.version != ''
name: Set release version
run: |
sed -i -e \
"s/\"version\": \".*\"/\"version\": \"${{ github.event.inputs.version }}\"/g" \
"./package.json"
- if: contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isAutoUpdateDisabled)
name: Turn off auto-update
run: |
echo "IS_AUTO_UPDATE_DISABLED=1" >> $GITHUB_ENV
- if: contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isBfxApiStaging)
name: Use BFX API Staging for queries
run: |
echo "IS_BFX_API_STAGING=1" >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: 18.17.1
- name: Cache Electron binaries
id: electron-cache
uses: actions/cache@v3
env:
cache-name: electron-cache-v1
with:
path: |
~/Library/Caches/electron
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Build release
id: release-builder
uses: nick-fields/retry@v2
continue-on-error: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ELECTRON_CACHE: ~/Library/Caches/electron
with:
timeout_minutes: 20
retry_wait_seconds: 10
max_attempts: 3
retry_on: any
command: ./scripts/build-release.sh -mp