-
Notifications
You must be signed in to change notification settings - Fork 3
366 lines (314 loc) · 13.7 KB
/
Copy pathrelease.yaml
File metadata and controls
366 lines (314 loc) · 13.7 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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
concurrency:
group: release-${{ github.ref_name }}
cancel-in-progress: false
env:
NODE_OPTIONS: "--max-old-space-size=4096"
GO_VERSION: "1.26"
NODE_VERSION: "20"
PNPM_VERSION: "10"
jobs:
# ─────────────────────────────────────────────────────────────────────────────
# macOS (darwin/universal) — sign, notarize, DMG
# ─────────────────────────────────────────────────────────────────────────────
build-macos:
runs-on: macos-latest
steps:
- name: Normalize version
id: version
shell: bash
run: |
version=$(echo "${{ github.ref_name }}" | sed 's/^v//')
echo "version=${version}" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: |
- args: []
- args: [--global, typescript]
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
cache-dependency-path: "go.sum"
- name: Install Wails
shell: bash
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Build runtime package
shell: bash
run: pnpm run build
working-directory: packages/omniviewdev-runtime
- name: Build Omniview
shell: bash
run: |
wails build -platform darwin/universal \
-webview2 download \
-ldflags "\
-X github.com/omniviewdev/omniview/internal/version.Version=${{ steps.version.outputs.version }} \
-X github.com/omniviewdev/omniview/internal/version.GitCommit=${{ github.sha }} \
-X github.com/omniviewdev/omniview/internal/version.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
-X github.com/omniviewdev/omniview/internal/version.Development=false \
-X github.com/omniviewdev/registry.OmniviewPublicKeyHex=${{ secrets.REGISTRY_PUBLIC_KEY_HEX }}"
- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
- name: Sign and Notarize
shell: bash
env:
APPLE_SIGN_ID: ${{ secrets.APPLE_DEVELOPER_SIGN_ID }}
NOTARY_USER: ${{ secrets.CLI_MACOS_NOTARY_USER }}
NOTARY_PWD: ${{ secrets.CLI_MACOS_NOTARY_PWD }}
TEAM_ID: ${{ secrets.CLI_MACOS_TEAM_ID }}
run: |
codesign --deep --force \
--options runtime \
--entitlements build/darwin/entitlements.plist \
--sign "$APPLE_SIGN_ID" \
build/bin/Omniview.app
ditto -c -k --keepParent --rsrc build/bin/Omniview.app archive.zip
xcrun notarytool submit archive.zip \
--apple-id "$NOTARY_USER" \
--password "$NOTARY_PWD" \
--team-id "$TEAM_ID" \
--wait
xcrun stapler staple build/bin/Omniview.app
spctl --assess --type execute --verbose build/bin/Omniview.app
- name: Checkout create-dmg
uses: actions/checkout@v4
with:
repository: create-dmg/create-dmg
path: ./build/create-dmg
ref: master
- name: Create DMG
shell: bash
working-directory: ./build
run: |
./create-dmg/create-dmg \
--no-internet-enable \
--volname "Omniview" \
--volicon "bin/Omniview.app/Contents/Resources/iconfile.icns" \
--text-size 12 \
--window-pos 400 400 \
--window-size 660 450 \
--icon-size 80 \
--icon "Omniview.app" 180 180 \
--hide-extension "Omniview.app" \
--app-drop-link 480 180 \
"bin/Omniview_${{ steps.version.outputs.version }}_darwin_universal.dmg" \
"bin"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macos-dmg
path: build/bin/Omniview_${{ steps.version.outputs.version }}_darwin_universal.dmg
if-no-files-found: error
retention-days: 1
# ─────────────────────────────────────────────────────────────────────────────
# Linux (linux/amd64)
# ─────────────────────────────────────────────────────────────────────────────
build-linux:
runs-on: ubuntu-latest
steps:
- name: Normalize version
id: version
shell: bash
run: |
version=$(echo "${{ github.ref_name }}" | sed 's/^v//')
echo "version=${version}" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: |
- args: []
- args: [--global, typescript]
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
cache-dependency-path: "go.sum"
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Build runtime package
run: pnpm run build
working-directory: packages/omniviewdev-runtime
- name: Build Omniview
run: |
wails build -platform linux/amd64 \
-tags webkit2_41 \
-webview2 download \
-ldflags "\
-X github.com/omniviewdev/omniview/internal/version.Version=${{ steps.version.outputs.version }} \
-X github.com/omniviewdev/omniview/internal/version.GitCommit=${{ github.sha }} \
-X github.com/omniviewdev/omniview/internal/version.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
-X github.com/omniviewdev/omniview/internal/version.Development=false \
-X github.com/omniviewdev/registry.OmniviewPublicKeyHex=${{ secrets.REGISTRY_PUBLIC_KEY_HEX }}"
- name: Rename executable
working-directory: ./build/bin
run: mv Omniview "Omniview_${{ steps.version.outputs.version }}_linux_amd64"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux-binary
path: build/bin/Omniview_${{ steps.version.outputs.version }}_linux_amd64
if-no-files-found: error
retention-days: 1
# ─────────────────────────────────────────────────────────────────────────────
# Windows (windows/amd64)
# ─────────────────────────────────────────────────────────────────────────────
build-windows:
runs-on: windows-latest
steps:
- name: Normalize version
id: version
shell: bash
run: |
version=$(echo "${{ github.ref_name }}" | sed 's/^v//')
echo "version=${version}" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: |
- args: []
- args: [--global, typescript]
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
cache-dependency-path: "go.sum"
- name: Install Wails
shell: bash
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Build runtime package
shell: bash
run: pnpm run build
working-directory: packages/omniviewdev-runtime
- name: Build Omniview
shell: bash
run: |
wails build -platform windows/amd64 \
-webview2 download \
-ldflags "\
-X github.com/omniviewdev/omniview/internal/version.Version=${{ steps.version.outputs.version }} \
-X github.com/omniviewdev/omniview/internal/version.GitCommit=${{ github.sha }} \
-X github.com/omniviewdev/omniview/internal/version.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
-X github.com/omniviewdev/omniview/internal/version.Development=false \
-X github.com/omniviewdev/registry.OmniviewPublicKeyHex=${{ secrets.REGISTRY_PUBLIC_KEY_HEX }}"
- name: Rename executable
working-directory: ./build/bin
run: Rename-Item -Path "Omniview.exe" -NewName "Omniview_${{ steps.version.outputs.version }}_windows_amd64.exe"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows-binary
path: build/bin/Omniview_${{ steps.version.outputs.version }}_windows_amd64.exe
if-no-files-found: error
retention-days: 1
# ─────────────────────────────────────────────────────────────────────────────
# NPM — publish @omniviewdev/* packages (runs in parallel with desktop builds)
# ─────────────────────────────────────────────────────────────────────────────
publish-npm:
uses: ./.github/workflows/npm-publish.yml
with:
version: ${{ github.ref_name }}
dist-tag: latest
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# ─────────────────────────────────────────────────────────────────────────────
# Publish — download all artifacts, checksums, GitHub Release, Homebrew
# ─────────────────────────────────────────────────────────────────────────────
publish:
runs-on: ubuntu-latest
needs: [build-macos, build-linux, build-windows]
steps:
- name: Normalize version
id: version
shell: bash
run: |
version=$(echo "${{ github.ref_name }}" | sed 's/^v//')
echo "version=${version}" >> "$GITHUB_OUTPUT"
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Collect release assets
shell: bash
run: |
mkdir -p release
cp artifacts/macos-dmg/*.dmg release/
cp artifacts/linux-binary/* release/
cp artifacts/windows-binary/*.exe release/
- name: Generate checksums
shell: bash
working-directory: release
run: sha256sum * > checksums_sha256.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: release/*
generate_release_notes: true
prerelease: ${{ contains(github.ref_name, '-') }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update Homebrew Cask
if: ${{ !contains(github.ref_name, '-') }}
shell: bash
env:
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
run: |
if [ -z "$HOMEBREW_TAP_TOKEN" ]; then
echo "::warning::HOMEBREW_TAP_TOKEN not set, skipping Homebrew update"
exit 0
fi
VERSION="${{ steps.version.outputs.version }}"
DMG_FILE="release/Omniview_${VERSION}_darwin_universal.dmg"
SHA256=$(sha256sum "$DMG_FILE" | awk '{print $1}')
git clone "https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/omniviewdev/homebrew-tap.git" tap
cd tap
sed -i "s/version \".*\"/version \"${VERSION}\"/" Casks/omniview.rb
sed -i "s/sha256 \".*\"/sha256 \"${SHA256}\"/" Casks/omniview.rb
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Casks/omniview.rb
git commit -m "Update omniview to ${VERSION}"
git push