-
Notifications
You must be signed in to change notification settings - Fork 15
332 lines (294 loc) · 11.9 KB
/
Copy pathrelease.yml
File metadata and controls
332 lines (294 loc) · 11.9 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# Build OpenView desktop release binaries.
#
# Triggers:
# - Git tags matching v* (e.g. v3.0.0) → create a GitHub Release
# - workflow_dispatch → manual build; upload workflow artifacts only
#
# Artifacts:
# OpenView-linux-x64.zip
# OpenView-linux-arm64.zip
# OpenView-windows-x64.zip
# OpenView-macos-universal.zip (Intel + Apple Silicon; ad-hoc signed — see the macOS job)
# SHA256SUMS.txt
#
# Desktop only. Mobile ships through the App Store and Google Play, and the
# Android APK / iOS pipeline is tracked separately — do not add a mobile job
# here without also sorting out release signing (see docs/mobile-deployment.md).
name: Release builds
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
env:
# Releases pin an exact Flutter version so a rebuild of a tag is reproducible
# and a bad upstream stable can never silently break a release.
FLUTTER_VERSION: 3.44.6
jobs:
# ── Guard: tag must match the pubspec version ──────────────────────────
# Cheap job that fails in ~10s rather than after four platform builds.
version:
name: Check version
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Tag matches pubspec version
if: startsWith(github.ref, 'refs/tags/')
run: |
tag="${GITHUB_REF_NAME#v}" # v3.0.0 → 3.0.0
pubspec=$(grep -m1 '^version:' pubspec.yaml | awk '{print $2}')
echo "tag=$tag pubspec=$pubspec"
if [ "$tag" != "${pubspec%%+*}" ]; then
echo "::error::Tag $GITHUB_REF_NAME does not match pubspec version $pubspec." \
"Bump pubspec.yaml or retag."
exit 1
fi
# ── Linux desktop ──────────────────────────────────────────────────────
linux:
name: Linux x64
needs: version
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache: true
- name: Install system packages
run: |
sudo apt-get update -y
sudo apt-get install -y \
clang cmake ninja-build pkg-config \
libgtk-3-dev liblzma-dev libstdc++-12-dev \
libudev-dev
- name: Flutter config & deps
run: |
flutter config --enable-linux-desktop
flutter pub get
- name: Build Linux release
# OV_CHANNEL=github enables the in-app update check (UpdateChannel).
# Only builds published here may point users at a GitHub Release zip;
# store builds must stay on the default `store` channel.
run: flutter build linux --release --dart-define=OV_CHANNEL=github
- name: Package
run: |
cd build/linux/x64/release/bundle
zip -r "$GITHUB_WORKSPACE/OpenView-linux-x64.zip" .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: OpenView-linux-x64
path: OpenView-linux-x64.zip
if-no-files-found: error
# ── Linux desktop (ARM64) ──────────────────────────────────────────────
# Native aarch64 build on GitHub's free arm64 runner, for Raspberry Pi and
# other ARM SBCs — a common host for ProtoCentral boards.
#
# Flutter does not publish prebuilt Linux *arm64* SDK archives, so
# subosito/flutter-action can't resolve a pinned version here ("Unable to
# determine Flutter version ... architecture: arm64"). Install the SDK with a
# shallow git clone at the version tag instead; `flutter` bootstraps the
# matching arm64 Dart SDK and engine artifacts on first run.
linux-arm64:
name: Linux arm64
needs: version
runs-on: ubuntu-24.04-arm
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Flutter (arm64 via git)
run: |
git clone --depth 1 --branch "$FLUTTER_VERSION" \
https://github.com/flutter/flutter.git "$HOME/flutter"
echo "$HOME/flutter/bin" >> "$GITHUB_PATH"
- name: Flutter version
run: flutter --version
- name: Install system packages
run: |
sudo apt-get update -y
sudo apt-get install -y \
clang cmake ninja-build pkg-config \
libgtk-3-dev liblzma-dev libstdc++-12-dev \
libudev-dev
- name: Flutter config & deps
run: |
flutter config --enable-linux-desktop
flutter pub get
- name: Build Linux release
# OV_CHANNEL=github enables the in-app update check (UpdateChannel).
# Only builds published here may point users at a GitHub Release zip;
# store builds must stay on the default `store` channel.
run: flutter build linux --release --dart-define=OV_CHANNEL=github
- name: Package
run: |
cd build/linux/arm64/release/bundle
zip -r "$GITHUB_WORKSPACE/OpenView-linux-arm64.zip" .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: OpenView-linux-arm64
path: OpenView-linux-arm64.zip
if-no-files-found: error
# ── Windows desktop ────────────────────────────────────────────────────
windows:
name: Windows x64
needs: version
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache: true
- name: Flutter config & deps
run: |
flutter config --enable-windows-desktop
flutter pub get
- name: Build Windows release
env:
# MSVC 14.51 (VS 18, on windows-latest) makes <experimental/coroutine>
# a hard error — STL1011 — and permission_handler_windows still
# includes it. cl.exe picks up extra flags from the CL env var, so we
# can silence it here instead of patching the plugin. Remove once
# permission_handler_windows moves to <coroutine>.
CL: /D_SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS
run: flutter build windows --release --dart-define=OV_CHANNEL=github
- name: Package
shell: pwsh
run: |
Compress-Archive -Path build/windows/x64/runner/Release/* `
-DestinationPath OpenView-windows-x64.zip -Force
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: OpenView-windows-x64
path: OpenView-windows-x64.zip
if-no-files-found: error
# ── macOS desktop ──────────────────────────────────────────────────────
# The Xcode project uses Automatic signing with a DEVELOPMENT_TEAM, so a plain
# `flutter build macos` on a runner fails ("No signing certificate 'Mac
# Development' found"). We therefore configure with Flutter and build with
# xcodebuild, overriding the signing settings on the command line (command-line
# settings outrank the ones baked into project.pbxproj).
#
# The app is ad-hoc signed: it runs, but it is not notarized, so Gatekeeper
# shows "Apple cannot check it for malicious software" on first launch and the
# user must right-click → Open (or clear the quarantine bit). Developer ID
# signing + notarization is a follow-up — the AC_CERTIFICATE / APPLE_* secrets
# for it already exist in this repo.
#
# Built as a universal binary (x86_64 + arm64) so a single download runs on
# both Intel and Apple Silicon Macs. The deployment target is 10.15, so Intel
# support reaches back to Catalina.
macos:
name: macOS universal
needs: version
runs-on: macos-latest
timeout-minutes: 90
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache: true
- name: Install build tools (libserialport)
run: brew install automake libtool
- name: Flutter config & deps
run: |
flutter config --enable-macos-desktop
flutter pub get
- name: Build macOS release
run: |
# Generate the ephemeral xcconfig / plugin registrant without building.
# The --dart-define is baked into Flutter-Generated.xcconfig here, so
# the xcodebuild step below inherits it.
flutter build macos --release --config-only \
--dart-define=OV_CHANNEL=github
# ARCHS + ONLY_ACTIVE_ARCH=NO force a universal (Intel + Apple Silicon)
# binary; the pods (libserialport) build both slices from source.
xcodebuild \
-workspace macos/Runner.xcworkspace \
-scheme Runner \
-configuration Release \
-derivedDataPath "$RUNNER_TEMP/dd" \
ARCHS="x86_64 arm64" \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGN_STYLE=Manual \
CODE_SIGN_IDENTITY=- \
PROVISIONING_PROFILE_SPECIFIER= \
build
- name: Package
run: |
app="$RUNNER_TEMP/dd/Build/Products/Release/OpenView.app"
if [ ! -d "$app" ]; then
echo "::error::OpenView.app not found at $app"
find "$RUNNER_TEMP/dd/Build/Products" -maxdepth 3 -name '*.app' || true
exit 1
fi
# Fail if the main binary is not actually universal.
archs=$(lipo -archs "$app/Contents/MacOS/OpenView")
echo "OpenView binary archs: $archs"
for want in x86_64 arm64; do
case " $archs " in
*" $want "*) ;;
*) echo "::error::macOS binary is missing the $want slice ($archs)"; exit 1 ;;
esac
done
codesign --verify --strict --verbose=2 "$app"
# ditto (not zip) preserves app-bundle metadata and symlinks.
ditto -c -k --sequesterRsrc --keepParent "$app" OpenView-macos-universal.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: OpenView-macos-universal
path: OpenView-macos-universal.zip
if-no-files-found: error
# ── Publish GitHub Release (tags only) ─────────────────────────────────
publish:
name: Publish GitHub Release
needs: [linux, linux-arm64, windows, macos]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: release
merge-multiple: true
- name: Checksums
working-directory: release
run: |
sha256sum ./*.zip | sed 's|\./||' | tee SHA256SUMS.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
fail_on_unmatched_files: true
files: |
release/OpenView-linux-x64.zip
release/OpenView-linux-arm64.zip
release/OpenView-windows-x64.zip
release/OpenView-macos-universal.zip
release/SHA256SUMS.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}