-
Notifications
You must be signed in to change notification settings - Fork 46
256 lines (215 loc) · 7.62 KB
/
release.yml
File metadata and controls
256 lines (215 loc) · 7.62 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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: '版本号 (如 1.0.0)'
required: true
default: '1.0.0'
create_release:
description: '是否创建 GitHub Release'
required: false
type: boolean
default: true
jobs:
build-android:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.inputs.version || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install dependencies
run: |
npm ci
cd h5 && npm ci
- name: Build H5
run: npm run build:h5
- name: Sync Capacitor
run: npx cap sync android
- name: Build APK (Debug)
run: |
cd android
chmod +x gradlew
./gradlew assembleDebug
- name: Build APK (Release)
if: env.KEYSTORE_BASE64 != ''
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
echo "$KEYSTORE_BASE64" | base64 -d > android/app/release.keystore
cd android
./gradlew assembleRelease \
-Pandroid.injected.signing.store.file=$PWD/app/release.keystore \
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD \
-Pandroid.injected.signing.key.alias=$KEY_ALIAS \
-Pandroid.injected.signing.key.password=$KEY_PASSWORD
- name: Rename APK files
run: |
VER="${VERSION#v}"
DEBUG_APK=$(find android/app/build/outputs/apk/debug -name '*.apk' | head -1)
[ -n "$DEBUG_APK" ] && cp "$DEBUG_APK" "android/app/build/outputs/apk/debug/clawapp-${VER}-debug.apk" || true
RELEASE_APK=$(find android/app/build/outputs/apk/release -name '*.apk' 2>/dev/null | head -1)
[ -n "$RELEASE_APK" ] && cp "$RELEASE_APK" "android/app/build/outputs/apk/release/clawapp-${VER}-release.apk" || true
- name: Upload Debug APK
uses: actions/upload-artifact@v4
with:
name: clawapp-debug-apk
path: android/app/build/outputs/apk/debug/clawapp-*-debug.apk
- name: Upload Release APK
if: env.KEYSTORE_BASE64 != ''
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
uses: actions/upload-artifact@v4
with:
name: clawapp-release-apk
path: android/app/build/outputs/apk/release/clawapp-*-release.apk
build-windows:
runs-on: windows-latest
env:
VERSION: ${{ github.event.inputs.version || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: |
cd h5 && npm ci
cd ../electron && npm ci
- name: Build H5
run: cd h5 && npx vite build
- name: Build Windows exe
run: cd electron && npx electron-builder --win --publish never
- name: Rename artifacts
shell: bash
run: |
VER="${VERSION#v}"
EXE=$(find electron/release -name '*.exe' | head -1)
[ -n "$EXE" ] && cp "$EXE" "electron/release/clawapp-${VER}-win-setup.exe"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: clawapp-windows
path: electron/release/clawapp-*-win-setup.exe
build-macos:
runs-on: macos-latest
env:
VERSION: ${{ github.event.inputs.version || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: |
cd h5 && npm ci
cd ../electron && npm ci
- name: Build H5
run: cd h5 && npx vite build
- name: Build macOS dmg
run: cd electron && npx electron-builder --mac --publish never
- name: Rename artifacts
run: |
VER="${VERSION#v}"
DMG=$(find electron/release -name '*.dmg' | head -1)
[ -n "$DMG" ] && cp "$DMG" "electron/release/clawapp-${VER}-mac.dmg"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: clawapp-macos
path: electron/release/clawapp-*-mac.dmg
build-linux:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.inputs.version || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: |
cd h5 && npm ci
cd ../electron && npm ci
- name: Build H5
run: cd h5 && npx vite build
- name: Build Linux AppImage
run: cd electron && npx electron-builder --linux --publish never
- name: Rename artifacts
run: |
VER="${VERSION#v}"
AI=$(find electron/release -name '*.AppImage' | head -1)
[ -n "$AI" ] && cp "$AI" "electron/release/clawapp-${VER}-linux.AppImage"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: clawapp-linux
path: electron/release/clawapp-*-linux.AppImage
release:
if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'true')
needs: [build-android, build-windows, build-macos, build-linux]
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.inputs.version || github.ref_name }}
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List artifacts
run: find artifacts -type f | head -50
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || format('v{0}', github.event.inputs.version) }}
name: ClawApp ${{ env.VERSION }}
body: |
## ClawApp ${{ env.VERSION }}
### 下载
| 平台 | 文件 | 说明 |
|------|------|------|
| Android | `clawapp-*-debug.apk` | Debug 版本,无需签名 |
| Windows | `clawapp-*-win-setup.exe` | Windows 安装包 |
| macOS | `clawapp-*-mac.dmg` | macOS 磁盘映像 |
| Linux | `clawapp-*-linux.AppImage` | Linux 免安装运行 |
### 使用方式
1. 下载对应平台的安装包
2. 安装并打开 ClawApp
3. 输入服务器地址和 Token 即可连接
### 相关链接
- [使用文档](https://github.com/qingchencloud/clawapp#readme)
- [产品主页](https://clawapp.qt.cool)
files: |
artifacts/clawapp-debug-apk/*
artifacts/clawapp-release-apk/*
artifacts/clawapp-windows/*
artifacts/clawapp-macos/*
artifacts/clawapp-linux/*
draft: false
prerelease: false
generate_release_notes: true