-
Notifications
You must be signed in to change notification settings - Fork 0
204 lines (172 loc) · 6.32 KB
/
Copy pathrelease-desktop.yml
File metadata and controls
204 lines (172 loc) · 6.32 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
name: Release Desktop
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release-windows:
name: Build and publish Windows
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 10
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: apps/kimi-code/pnpm-lock.yaml
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install frontend dependencies
working-directory: apps/kimi-code
run: pnpm install --frozen-lockfile
- name: Verify tag matches app version
shell: pwsh
run: |
$config = Get-Content apps/kimi-code/src-tauri/tauri.conf.json | ConvertFrom-Json
$expectedTag = "v$($config.version)"
if ("${{ github.ref_name }}" -ne $expectedTag) {
throw "Tag ${{ github.ref_name }} does not match app version $expectedTag"
}
- name: Build and publish Kimi Code for Windows
uses: tauri-apps/tauri-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
with:
projectPath: apps/kimi-code
tagName: ${{ github.ref_name }}
releaseName: Kimi Code ${{ github.ref_name }}
releaseDraft: false
prerelease: false
releaseAssetNamePattern: '[name]_[version]_windows_[arch][setup][ext]'
- name: Finalize release metadata
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node .github/scripts/update-release-downloads.mjs
release-linux:
name: Build and publish Linux AppImage and Debian package
needs: release-windows
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf xdg-utils
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 10
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: apps/kimi-code/pnpm-lock.yaml
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install frontend dependencies
working-directory: apps/kimi-code
run: pnpm install --frozen-lockfile
- name: Verify tag matches app version
shell: bash
run: |
app_version="$(jq -r .version apps/kimi-code/src-tauri/tauri.conf.json)"
expected_tag="v${app_version}"
if [[ "${GITHUB_REF_NAME}" != "${expected_tag}" ]]; then
echo "Tag ${GITHUB_REF_NAME} does not match app version ${expected_tag}" >&2
exit 1
fi
- name: Build and publish Kimi Code for Linux
uses: tauri-apps/tauri-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
with:
projectPath: apps/kimi-code
tagName: ${{ github.ref_name }}
releaseName: Kimi Code ${{ github.ref_name }}
releaseDraft: false
prerelease: false
releaseAssetNamePattern: '[name]_[version]_linux_[arch][ext]'
args: --bundles appimage,deb
- name: Finalize release metadata
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node .github/scripts/update-release-downloads.mjs
release-macos:
name: Build and publish macOS
needs: release-linux
runs-on: macos-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 10
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: apps/kimi-code/pnpm-lock.yaml
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin
- name: Install frontend dependencies
working-directory: apps/kimi-code
run: pnpm install --frozen-lockfile
- name: Verify tag matches app version
shell: bash
run: |
app_version="$(node -p "require('./apps/kimi-code/src-tauri/tauri.conf.json').version")"
expected_tag="v${app_version}"
if [[ "${GITHUB_REF_NAME}" != "${expected_tag}" ]]; then
echo "Tag ${GITHUB_REF_NAME} does not match app version ${expected_tag}" >&2
exit 1
fi
- name: Build and publish Kimi Code for Apple Silicon
uses: tauri-apps/tauri-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
with:
projectPath: apps/kimi-code
tagName: ${{ github.ref_name }}
releaseName: Kimi Code ${{ github.ref_name }}
releaseDraft: false
prerelease: false
releaseAssetNamePattern: '[name]_[version]_macos_[arch][ext]'
args: --target aarch64-apple-darwin
- name: Finalize release metadata
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node .github/scripts/update-release-downloads.mjs
- name: Build and publish Kimi Code for Intel Mac
uses: tauri-apps/tauri-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
with:
projectPath: apps/kimi-code
tagName: ${{ github.ref_name }}
releaseName: Kimi Code ${{ github.ref_name }}
releaseDraft: false
prerelease: false
releaseAssetNamePattern: '[name]_[version]_macos_[arch][ext]'
args: --target x86_64-apple-darwin
- name: Finalize release metadata
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node .github/scripts/update-release-downloads.mjs