55 tags :
66 - ' v*'
77 - ' cli-v*'
8- - ' gui-v*'
98 workflow_dispatch :
109 inputs :
1110 version :
1211 description : ' Version to release (e.g., 0.1.0)'
1312 required : true
14- release_type :
15- description : ' Release type'
16- required : true
17- type : choice
18- options :
19- - both
20- - cli
21- - gui
2213
2314env :
2415 CARGO_TERM_COLOR : always
4940 outputs :
5041 version : ${{ steps.version.outputs.version }}
5142 tag : ${{ steps.version.outputs.tag }}
52- build_cli : ${{ steps.version.outputs.build_cli }}
53- build_gui : ${{ steps.version.outputs.build_gui }}
5443 cache_key : ${{ steps.cache.outputs.key }}
5544 steps :
5645 - uses : actions/checkout@v4
@@ -65,40 +54,19 @@ jobs:
6554 run : |
6655 if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
6756 VERSION="${{ inputs.version }}"
68- if [ "${{ inputs.release_type }}" = "cli" ]; then
69- TAG="cli-v${VERSION}"
70- echo "build_cli=true" >> $GITHUB_OUTPUT
71- echo "build_gui=false" >> $GITHUB_OUTPUT
72- elif [ "${{ inputs.release_type }}" = "gui" ]; then
73- TAG="gui-v${VERSION}"
74- echo "build_cli=false" >> $GITHUB_OUTPUT
75- echo "build_gui=true" >> $GITHUB_OUTPUT
76- else
77- TAG="v${VERSION}"
78- echo "build_cli=true" >> $GITHUB_OUTPUT
79- echo "build_gui=true" >> $GITHUB_OUTPUT
80- fi
57+ TAG="v${VERSION}"
8158 else
8259 TAG="${GITHUB_REF#refs/tags/}"
8360 if [[ "$TAG" == cli-v* ]]; then
8461 VERSION="${TAG#cli-v}"
85- echo "build_cli=true" >> $GITHUB_OUTPUT
86- echo "build_gui=false" >> $GITHUB_OUTPUT
87- elif [[ "$TAG" == gui-v* ]]; then
88- VERSION="${TAG#gui-v}"
89- echo "build_cli=false" >> $GITHUB_OUTPUT
90- echo "build_gui=true" >> $GITHUB_OUTPUT
9162 else
9263 VERSION="${TAG#v}"
93- echo "build_cli=true" >> $GITHUB_OUTPUT
94- echo "build_gui=true" >> $GITHUB_OUTPUT
9564 fi
9665 fi
9766 echo "version=$VERSION" >> $GITHUB_OUTPUT
9867 echo "tag=$TAG" >> $GITHUB_OUTPUT
9968
10069 - name : Verify CLI version consistency
101- if : steps.version.outputs.build_cli == 'true'
10270 run : |
10371 CLI_RELEASE_VERSION="${{ steps.version.outputs.version }}" ./scripts/check-cli-version.sh
10472
10977 name : CLI ${{ matrix.artifact }}
11078 runs-on : ${{ matrix.runner }}
11179 needs : prepare
112- if : needs.prepare.outputs.build_cli == 'true'
11380 strategy :
11481 fail-fast : false
11582 matrix :
@@ -339,160 +306,13 @@ jobs:
339306 ${{ matrix.artifact }}.zip
340307 if-no-files-found : ignore
341308
342- # ==========================================================================
343- # Build GUI Binaries (Tauri) - 32 vCPU for compilation
344- # ==========================================================================
345- build-gui :
346- name : GUI ${{ matrix.artifact }}
347- runs-on : ${{ matrix.runner }}
348- needs : prepare
349- if : needs.prepare.outputs.build_gui == 'true'
350- strategy :
351- fail-fast : false
352- matrix :
353- include :
354- - name : Windows x64
355- runner : blacksmith-32vcpu-windows-2025
356- target : x86_64-pc-windows-msvc
357- artifact : cortex-gui-windows-x64
358- bundle : msi
359-
360- - name : macOS x64
361- runner : macos-13
362- target : x86_64-apple-darwin
363- artifact : cortex-gui-macos-x64
364- bundle : dmg
365-
366- - name : macOS ARM64
367- runner : macos-latest
368- target : aarch64-apple-darwin
369- artifact : cortex-gui-macos-arm64
370- bundle : dmg
371-
372- - name : Linux x64
373- runner : blacksmith-32vcpu-ubuntu-2204
374- target : x86_64-unknown-linux-gnu
375- artifact : cortex-gui-linux-x64
376- bundle : appimage
377-
378- steps :
379- - uses : actions/checkout@v4
380-
381- - uses : pnpm/action-setup@v4
382-
383- - uses : actions/setup-node@v4
384- with :
385- node-version : " 20"
386- cache : " pnpm"
387- cache-dependency-path : cortex-gui/pnpm-lock.yaml
388-
389- - name : Install Rust nightly
390- uses : dtolnay/rust-toolchain@nightly
391- with :
392- targets : ${{ matrix.target }}
393-
394- - name : Install system dependencies (Linux)
395- if : runner.os == 'Linux'
396- run : |
397- sudo apt-get update
398- sudo apt-get install -y \
399- libwebkit2gtk-4.1-dev \
400- librsvg2-dev \
401- patchelf \
402- libssl-dev \
403- libgtk-3-dev \
404- libayatana-appindicator3-dev
405-
406- - name : Setup Rust cache (Blacksmith optimized)
407- if : contains(matrix.runner, 'blacksmith')
408- uses : useblacksmith/rust-cache@v3
409- with :
410- prefix-key : " rust-release-gui-${{ matrix.target }}"
411- shared-key : ${{ needs.prepare.outputs.cache_key }}
412- workspaces : |
413- .
414- cortex-gui/src-tauri
415-
416- - name : Setup Rust cache (non-Blacksmith)
417- if : " !contains(matrix.runner, 'blacksmith')"
418- uses : Swatinem/rust-cache@v2
419- with :
420- prefix-key : " rust-release-gui-${{ matrix.target }}"
421- shared-key : ${{ needs.prepare.outputs.cache_key }}
422- workspaces : |
423- .
424- cortex-gui/src-tauri
425-
426- - name : Cache pnpm (Blacksmith 4x faster cache)
427- uses : actions/cache@v4
428- with :
429- path : |
430- cortex-gui/node_modules
431- ~/.local/share/pnpm/store
432- key : pnpm-${{ matrix.runner }}-${{ hashFiles('cortex-gui/pnpm-lock.yaml') }}
433- restore-keys : |
434- pnpm-${{ matrix.runner }}-
435-
436- - name : Install frontend dependencies
437- working-directory : cortex-gui
438- run : pnpm install --frozen-lockfile
439-
440- - name : Build Tauri app
441- uses : tauri-apps/tauri-action@v0
442- env :
443- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
444- TAURI_SIGNING_PRIVATE_KEY : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
445- TAURI_SIGNING_PRIVATE_KEY_PASSWORD : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
446- RUSTFLAGS : " -Zthreads=32"
447- with :
448- projectPath : cortex-gui
449- tauriScript : pnpm tauri
450- args : --target ${{ matrix.target }} --bundles ${{ matrix.bundle }}
451-
452- - name : Collect artifacts (Unix)
453- if : runner.os != 'Windows'
454- run : |
455- mkdir -p collected
456- BUNDLE_DIR="target/${{ matrix.target }}/release/bundle"
457- if [ ! -d "$BUNDLE_DIR" ]; then
458- BUNDLE_DIR="cortex-gui/src-tauri/target/${{ matrix.target }}/release/bundle"
459- fi
460-
461- if [ "${{ matrix.bundle }}" = "dmg" ]; then
462- find "$BUNDLE_DIR" -name "*.dmg" -exec cp {} collected/ \;
463- elif [ "${{ matrix.bundle }}" = "appimage" ]; then
464- find "$BUNDLE_DIR" -name "*.AppImage" -exec cp {} collected/ \;
465- fi
466-
467- ls -la collected/
468-
469- - name : Collect artifacts (Windows)
470- if : runner.os == 'Windows'
471- shell : pwsh
472- run : |
473- New-Item -ItemType Directory -Force -Path collected
474- $bundleDir = "target/${{ matrix.target }}/release/bundle"
475- if (-not (Test-Path $bundleDir)) {
476- $bundleDir = "cortex-gui/src-tauri/target/${{ matrix.target }}/release/bundle"
477- }
478-
479- Get-ChildItem -Path $bundleDir -Recurse -Include *.msi | Copy-Item -Destination collected/
480- Get-ChildItem collected/
481-
482- - name : Upload artifact
483- uses : actions/upload-artifact@v4
484- with :
485- name : ${{ matrix.artifact }}
486- path : collected/*
487- if-no-files-found : warn
488-
489309 # ==========================================================================
490310 # Create GitHub Release (lightweight - 4 vCPU)
491311 # ==========================================================================
492312 release :
493313 name : Create Release
494- needs : [prepare, build-cli, build-gui ]
495- if : always() && needs.prepare.result == 'success' && ( needs.build-cli.result == 'success' || needs.build-cli.result == 'skipped') && (needs.build-gui.result == 'success' || needs.build-gui.result == 'skipped')
314+ needs : [prepare, build-cli]
315+ if : always() && needs.prepare.result == 'success' && needs.build-cli.result == 'success'
496316 runs-on : blacksmith-4vcpu-ubuntu-2404
497317 steps :
498318 - uses : actions/checkout@v4
@@ -528,8 +348,6 @@ jobs:
528348 VERSION="${{ needs.prepare.outputs.version }}"
529349 if [[ "$TAG" == cli-v* ]]; then
530350 echo "name=Cortex CLI v${VERSION}" >> $GITHUB_OUTPUT
531- elif [[ "$TAG" == gui-v* ]]; then
532- echo "name=Cortex GUI v${VERSION}" >> $GITHUB_OUTPUT
533351 else
534352 echo "name=Cortex v${VERSION}" >> $GITHUB_OUTPUT
535353 fi
0 commit comments