1919 description : ' Tag Version (e.g. 1.0.0)'
2020 required : true
2121 type : string
22- disable-rust-cache :
23- description : ' Disable Rust cache (useful for troubleshooting build issues)'
24- required : false
25- type : boolean
26- default : false
2722
2823jobs :
2924 # Set version first
@@ -122,14 +117,8 @@ jobs:
122117 args : ' --target x86_64-apple-darwin'
123118 - platform : ' ubuntu-22.04' # Linux Platform
124119 args : ' '
125- - platform : ' windows-latest' # Windows Platform (CPU)
120+ - platform : ' windows-latest' # Windows Platform
126121 args : ' '
127- features : ' --features whisper-cpu'
128- variant : ' cpu'
129- - platform : ' windows-latest' # Windows Platform (CUDA)
130- args : ' '
131- features : ' --features whisper-cuda'
132- variant : ' cuda'
133122
134123 runs-on : ${{ matrix.platform }}
135124 steps :
@@ -143,77 +132,21 @@ jobs:
143132 name : tauri-config
144133 path : app/src-tauri/
145134
146- - name : Install CUDA Toolkit (Windows CUDA)
147- if : matrix.platform == 'windows-latest' && matrix.variant == 'cuda'
148- 149- id : cuda-toolkit
150- with :
151- cuda : ' 12.5.0'
152- method : ' network'
153- sub-packages : ' [ "nvcc", "cudart", "cublas", "cublas_dev", "curand", "curand_dev", "visual_studio_integration", "thrust" ]'
154-
155- - name : Set CUDA environment variables (Windows CUDA)
156- if : matrix.platform == 'windows-latest' && matrix.variant == 'cuda'
157- run : |
158- echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"
159- echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
160- echo "CUDA_PATH=${{steps.cuda-toolkit.outputs.CUDA_PATH}}" >> $GITHUB_ENV
161- echo "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin" >> $GITHUB_PATH
162- nvcc -V
163-
164-
165- - name : Fix CUDA Visual Studio Integration (Windows CUDA)
166- if : matrix.platform == 'windows-latest' && matrix.variant == 'cuda'
167- run : |
168- $cudaPath = "${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
169- echo "CUDA Path: $cudaPath"
170-
171- # Source: CUDA Visual Studio integration files
172- $sourceDir = "$cudaPath\extras\visual_studio_integration\MSBuildExtensions"
173- echo "Source: $sourceDir"
174-
175- # Find Visual Studio installation
176- $vsPaths = @(
177- "C:\Program Files\Microsoft Visual Studio\2022\Enterprise",
178- "C:\Program Files\Microsoft Visual Studio\2022\Community",
179- "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
180- )
181-
182- foreach ($vsPath in $vsPaths) {
183- $destDir = "$vsPath\MSBuild\Microsoft\VC\v170\BuildCustomizations"
184- if (Test-Path $destDir) {
185- echo "Found VS at: $vsPath"
186- echo "Destination: $destDir"
187-
188- if (Test-Path $sourceDir) {
189- echo "Copying CUDA integration files..."
190- Copy-Item "$sourceDir\*" $destDir -Force -Verbose
191- echo "Successfully copied CUDA integration files to $destDir"
192- } else {
193- echo "ERROR: Source directory not found: $sourceDir"
194- }
195- break
196- }
197- }
198-
199- # Set environment variable for CMake to use CUDA toolset
200- echo "CMAKE_GENERATOR_TOOLSET=cuda=$cudaPath" >> $GITHUB_ENV
201-
202135 - name : Fix version format for Windows MSI
203136 if : matrix.platform == 'windows-latest'
204137 run : |
205138 $versionJson = Get-Content -Path app/src-tauri/tauri.conf.json | ConvertFrom-Json
206139 $currentVersion = $versionJson.version
207-
140+
208141 if ($currentVersion -match '-(.+)$') {
209142 $newVersion = $currentVersion -replace '-(.+)$', ''
210-
143+
211144 $versionJson.version = $newVersion
212-
145+
213146 $jsonContent = Get-Content -Path app/src-tauri/tauri.conf.json -Raw
214147 $jsonContent = $jsonContent -replace '"version": "([^"]+)"', "`"version`": `"$newVersion`""
215148 $jsonContent | Set-Content -Path app/src-tauri/tauri.conf.json -NoNewline
216-
149+
217150 echo "Windows version $currentVersion changed to $newVersion"
218151 } else {
219152 echo "Version $currentVersion does not need to be modified"
@@ -243,10 +176,8 @@ jobs:
243176 uses : dtolnay/rust-toolchain@stable
244177 with :
245178 targets : ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
246- components : ${{ matrix.platform == 'windows-latest' && 'rustfmt' || '' }}
247179
248180 - name : Rust Cache
249- if : github.event.inputs.disable-rust-cache != 'true'
250181 uses : Swatinem/rust-cache@v2
251182 with :
252183 workspaces : app/src-tauri
@@ -263,15 +194,8 @@ jobs:
263194
264195 - name : Install Dependencies
265196 run : |
266- bun install --frozen-lockfile
267-
268-
269- # Copy CUDA config for CUDA builds (with installer checks)
270- - name : Use CUDA config (Windows CUDA)
271- if : matrix.platform == 'windows-latest' && matrix.variant == 'cuda'
272- run : |
273- Copy-Item "app\src-tauri\tauri.cuda.conf.json" "app\src-tauri\tauri.conf.json" -Force
274- echo "Using CUDA configuration with installer CUDA detection"
197+ bun install
198+ cd app && bun install
275199
276200 # Using official Tauri Action to build and publish
277201 - name : Build and Publish Desktop App
@@ -282,9 +206,10 @@ jobs:
282206 TAURI_SIGNING_PRIVATE_KEY_PASSWORD : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
283207 with :
284208 projectPath : ' app'
285- args : ${{ matrix.args }} ${{ matrix.features || '' }}
209+ tauriScript : ' ../node_modules/.bin/tauri'
210+ args : ${{ matrix.args }}
286211 tagName : ${{ needs.set-version.outputs.version }}
287- releaseName : Blinko ${{ needs.set-version.outputs.version }}${{ matrix.variant && format(' ({0})', matrix.variant) || '' }}
212+ releaseName : Blinko ${{ needs.set-version.outputs.version }}
288213 releaseBody : " Under construction, full changelog will be updated after build completion..."
289214 releaseDraft : false
290215 prerelease : false
@@ -334,7 +259,6 @@ jobs:
334259 targets : aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
335260
336261 - name : Rust Cache
337- if : github.event.inputs.disable-rust-cache != 'true'
338262 uses : Swatinem/rust-cache@v2
339263 with :
340264 workspaces : app/src-tauri
@@ -356,7 +280,8 @@ jobs:
356280
357281 - name : Install Dependencies
358282 run : |
359- bun install --frozen-lockfile
283+ bun install
284+ cd app && bun install
360285
361286 - name : Run Prisma Generate
362287 run : bun run prisma:generate
@@ -371,7 +296,9 @@ jobs:
371296 restore-keys : |
372297 ${{ runner.os }}-gradle-
373298
374-
299+ - name : Install Tauri CLI
300+ run : cargo install tauri-cli --version "^2.0.0-alpha"
301+
375302 - name : Upload Keystore File
376303 run : |
377304 # Create keystore directory
@@ -498,6 +425,7 @@ jobs:
498425 console.log('Generated Chinese message');
499426 } catch (error) {
500427 console.error('Error calling OpenRouter API:', error.message);
428+ // 如果API调用失败,使用默认消息
501429 const defaultMessage = `🚀 Blinko ${{ needs.set-version.outputs.version }} 已发布!\n\n📝 更新日志:\n${{ needs.generate-changelog.outputs.changelog }}\n\n📥 下载链接:\nhttps://github.com/${{ github.repository }}/releases/tag/${{ needs.set-version.outputs.version }}`;
502430 core.setOutput('message', defaultMessage);
503431 }
@@ -541,6 +469,7 @@ jobs:
541469 console.log('Generated English message');
542470 } catch (error) {
543471 console.error('Error calling OpenRouter API:', error.message);
472+ // 如果API调用失败,使用默认消息
544473 const defaultMessage = `🚀 Blinko ${{ needs.set-version.outputs.version }} has been released!\n\n📝 Changelog:\n${{ needs.generate-changelog.outputs.changelog }}\n\n📥 Download:\nhttps://github.com/${{ github.repository }}/releases/tag/${{ needs.set-version.outputs.version }}`;
545474 core.setOutput('message', defaultMessage);
546475 }
@@ -570,4 +499,4 @@ jobs:
570499 format : html
571500 debug : true
572501 message : |
573- ${{ needs.process-notification.outputs.english_message }}
502+ ${{ needs.process-notification.outputs.english_message }}
0 commit comments