Repository navigation
197 lines (169 loc) · 7.05 KB
/
Copy pathrelease-app.yml
File metadata and controls
197 lines (169 loc) · 7.05 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
name: Release App
on:
push:
tags: ['app-v*']
workflow_dispatch:
permissions:
contents: write
concurrency:
group: release-app-${{ github.ref }}
cancel-in-progress: false
jobs:
check:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.release.outputs.tag }}
version: ${{ steps.release.outputs.version }}
notes: ${{ steps.release.outputs.notes }}
steps:
- uses: actions/checkout@v5
- id: release
uses: while-coder/workflows/.github/actions/resolve-release-info@main
with:
tag-prefix: app-v
package-json: packages/apps/client/package.json
changelog: packages/apps/client/CHANGELOG.md
prepare-release:
needs: check
runs-on: ubuntu-latest
steps:
- name: Recreate GitHub Release
uses: while-coder/workflows/.github/actions/recreate-github-release@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.check.outputs.tag }}
title: app v${{ needs.check.outputs.version }}
notes: ${{ needs.check.outputs.notes }}
release-desktop:
needs: [check, prepare-release]
uses: while-coder/workflows/.github/workflows/tauri-desktop-release.yml@main
with:
project-path: packages/apps/client
cargo-lock-path: packages/apps/client/src-tauri/Cargo.lock
cargo-target-path: packages/apps/client/src-tauri/target
tag-name: ${{ needs.check.outputs.tag }}
release-name: app v${{ needs.check.outputs.version }}
release-body: ${{ needs.check.outputs.notes }}
secrets: inherit
# 桌面启动器(捆绑 Node + sbot 后端):不能复用外部 reusable workflow——
# 它没有 build-command 钩子且 macOS 固定 universal target,与单架构 node sidecar 冲突
release-desktop-launcher:
needs: [check, prepare-release]
strategy:
fail-fast: false
matrix:
include:
- { os: windows-latest, target: x86_64-pc-windows-msvc }
- { os: macos-14, target: aarch64-apple-darwin }
- { os: macos-13, target: x86_64-apple-darwin }
- { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: while-coder/workflows/.github/actions/setup-pnpm@main
# 主版本必须与 packages/apps/desktop/scripts/versions.json 一致(原生模块 ABI 匹配)
- uses: actions/setup-node@v4
with:
node-version: 24
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: packages/apps/desktop/src-tauri
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev librsvg2-dev patchelf libssl-dev
- run: pnpm install --frozen-lockfile
- name: Build sbot backend bundle
run: pnpm run build:sbot
- name: Build desktop launcher
run: pnpm --filter @sbot/desktop run build
# MVP 用 ad-hoc 签名保证嵌套 Mach-O 有效;Developer ID 签名 + 公证待后续接入
- name: Sign bundled node (macOS)
if: runner.os == 'macOS'
run: |
for f in packages/apps/desktop/src-tauri/binaries/node-*; do
codesign --force --options runtime --sign - "$f"
done
- name: Upload bundles to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
TAG: ${{ needs.check.outputs.tag }}
shell: bash
run: |
DIR="packages/apps/desktop/src-tauri/target/release/bundle"
FILES=$(find "$DIR" -type f \( -name "*-setup.exe" -o -name "*.dmg" -o -name "*.deb" -o -name "*.AppImage" \))
echo "Uploading:"; echo "$FILES"
[ -n "$FILES" ] && gh release upload "$TAG" $FILES -R "$REPO" --clobber
release-android:
needs: [check, release-desktop]
if: ${{ !cancelled() && needs.release-desktop.result == 'success' }}
uses: while-coder/workflows/.github/workflows/tauri-android-release.yml@main
with:
project-path: packages/apps/client
cargo-lock-path: packages/apps/client/src-tauri/Cargo.lock
cargo-target-path: packages/apps/client/src-tauri/target
tag-name: ${{ needs.check.outputs.tag }}
version: ${{ needs.check.outputs.version }}
asset-prefix: sbot-client
build-command: pnpm android:build --apk --aab
secrets: inherit
release-ios:
needs: [check, release-desktop]
if: ${{ !cancelled() && needs.release-desktop.result == 'success' }}
uses: while-coder/workflows/.github/workflows/tauri-ios-unsigned.yml@main
with:
project-path: packages/apps/client
cargo-lock-path: packages/apps/client/src-tauri/Cargo.lock
cargo-target-path: packages/apps/client/src-tauri/target
tag-name: ${{ needs.check.outputs.tag }}
version: ${{ needs.check.outputs.version }}
asset-prefix: sbot-client
init-command: pnpm ios:init
build-command: pnpm ios:build --target aarch64 --no-sign --ci
secrets: inherit
publish-vscode:
needs: [check, release-desktop]
if: ${{ !cancelled() && needs.release-desktop.result == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: while-coder/workflows/.github/actions/setup-pnpm@main
- run: pnpm install --frozen-lockfile
- name: Build extension
run: pnpm run build:vscode
- name: Verify VS Code extension version
id: vscode
shell: bash
run: |
VERSION=$(node -p "require('./packages/apps/sbot-vscode/package.json').version")
if [ "$VERSION" != "${{ needs.check.outputs.version }}" ]; then
echo "::error::App version (${{ needs.check.outputs.version }}) does not match packages/apps/sbot-vscode/package.json version ($VERSION). Run pnpm run release:app to keep them in sync."
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Package VSIX
working-directory: packages/apps/sbot-vscode
run: npx --yes @vscode/vsce package --no-dependencies --out "sbot-vscode-${{ steps.vscode.outputs.version }}.vsix"
- name: Upload VSIX to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
TAG: ${{ needs.check.outputs.tag }}
VERSION: ${{ steps.vscode.outputs.version }}
run: gh release upload "$TAG" "packages/apps/sbot-vscode/sbot-vscode-${VERSION}.vsix" -R "$REPO" --clobber
publish-manifest:
needs: [check, release-desktop]
if: ${{ !cancelled() && needs.release-desktop.result == 'success' }}
uses: while-coder/workflows/.github/workflows/tauri-updater-manifest.yml@main
with:
product-prefix: sbot-client
source-product-name: SBot
tag-name: ${{ needs.check.outputs.tag }}
version: ${{ needs.check.outputs.version }}
release-notes: ${{ needs.check.outputs.notes }}
output-name: latest-app.json
updater-title: Updater Manifests
secrets: inherit