-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (122 loc) · 3.93 KB
/
Copy pathdesktop-build.yml
File metadata and controls
144 lines (122 loc) · 3.93 KB
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
138
139
140
141
142
143
144
name: 🛠️ Desktop CI
on:
pull_request:
branches:
- main
paths:
- 'apps/core/**'
- 'apps/desktop/**'
- '.github/workflows/desktop-build.yml'
- '.github/workflows/mildstack-release.yml'
permissions:
contents: read
concurrency:
group: desktop-ci-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
build-cli:
name: Build CLI Binaries
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26.2'
cache: true
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22.12
cache: 'npm'
cache-dependency-path: apps/desktop/package-lock.json
- name: Install dependencies
working-directory: apps/desktop
run: npm ci --prefer-offline
env:
npm_config_fetch_retries: 5
npm_config_fetch_retry_mintimeout: 20000
npm_config_fetch_retry_maxtimeout: 120000
- name: Build Go CLI binaries
working-directory: apps/desktop
run: npm run build:cli
- name: Upload CLI artifacts
uses: actions/upload-artifact@v4
with:
name: ci-cli-binaries
path: apps/desktop/resources/bin/
if-no-files-found: error
retention-days: 3
build-desktop:
name: Build Desktop (${{ matrix.label }})
needs: build-cli
runs-on: ${{ matrix.os }}
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
label: macOS
platform: mac
- os: windows-latest
label: Windows
platform: win
- os: ubuntu-latest
label: Linux
platform: linux
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22.12
cache: 'npm'
cache-dependency-path: apps/desktop/package-lock.json
- name: Install dependencies
working-directory: apps/desktop
run: npm ci --prefer-offline
env:
npm_config_fetch_retries: 5
npm_config_fetch_retry_mintimeout: 20000
npm_config_fetch_retry_maxtimeout: 120000
- name: Download CLI artifacts
uses: actions/download-artifact@v4
with:
name: ci-cli-binaries
path: apps/desktop/resources/bin/
- name: Make binaries executable
if: runner.os != 'Windows'
run: find apps/desktop/resources/bin -type f -exec chmod +x {} +
- name: Clean dist directory
shell: bash
run: rm -rf apps/desktop/dist
- name: Build Electron app source
working-directory: apps/desktop
run: npm run build
env:
NODE_OPTIONS: '--max-old-space-size=8192'
- name: Build Electron app
working-directory: apps/desktop
run: npx --no-install electron-builder --${{ matrix.platform }} --publish never
env:
NODE_OPTIONS: '--max-old-space-size=8192'
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
- name: Verify macOS app code signature consistency
if: matrix.platform == 'mac'
shell: bash
run: |
app_paths="$(find apps/desktop/dist -maxdepth 3 -type d -name "MildStack Desktop.app" | sort)"
if [[ -z "$app_paths" ]]; then
echo "No macOS app bundle found under apps/desktop/dist"
exit 1
fi
while IFS= read -r app_path; do
[[ -z "$app_path" ]] && continue
echo "Verifying: $app_path"
codesign --verify --deep --strict --verbose=2 "$app_path"
codesign -dv --verbose=4 "$app_path" 2>&1 | sed -n '1,40p'
done <<< "$app_paths"