mirror of
https://github.com/tiennm99/claude-code-usage-bubble.git
synced 2026-10-22 16:15:40 +00:00
Rename the crate, binary, product name, identifier, settings folder, log file, autostart entry, user agent, updater endpoint and release assets. Legacy Win32 clients still update: they fall back to the first .exe asset, and the legacy rollback workflow reads the package name from the ref it builds. Upgraded installs start with default settings.
97 lines
2.6 KiB
YAML
97 lines
2.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, feat/tauri-port]
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [windows-latest, ubuntu-22.04]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy, rustfmt
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
node-version: lts/*
|
|
cache: npm
|
|
|
|
- name: Install Linux build prerequisites
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file \
|
|
libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev
|
|
|
|
- run: npm ci
|
|
|
|
- run: cargo fmt --check
|
|
|
|
- run: cargo clippy --all-targets --locked -- -D warnings
|
|
|
|
- run: cargo test --locked
|
|
|
|
- run: npm run lint
|
|
|
|
- run: npm test
|
|
|
|
- run: npm run tauri build -- --no-bundle
|
|
|
|
# The bundler has no icon fallback, so a bad bundle.icon list only
|
|
# breaks packaging; the deb needs no patchelf and catches it early.
|
|
- name: Bundle the deb
|
|
if: runner.os == 'Linux'
|
|
run: npm run tauri build -- --bundles deb
|
|
|
|
- name: Check the exe version resource
|
|
if: runner.os == 'Windows'
|
|
shell: pwsh
|
|
run: |
|
|
$match = Select-String -Path Cargo.toml -Pattern '^version\s*=\s*"([^"]+)"' | Select-Object -First 1
|
|
$cargoVersion = $match.Matches.Groups[1].Value
|
|
$info = (Get-Item target/release/usage-monitor.exe).VersionInfo
|
|
$info | Format-List ProductName, CompanyName, FileDescription, FileVersion, ProductVersion, LegalCopyright
|
|
if ($info.ProductVersion -ne $cargoVersion) {
|
|
Write-Error "ProductVersion '$($info.ProductVersion)' does not match Cargo.toml version '$cargoVersion'"
|
|
exit 1
|
|
}
|
|
|
|
- name: Upload the Windows exe
|
|
if: runner.os == 'Windows'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: bubble-exe-${{ github.sha }}
|
|
path: target/release/usage-monitor.exe
|
|
retention-days: 7
|
|
if-no-files-found: error
|
|
|
|
macos-check:
|
|
name: macos-latest (cargo check)
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- run: cargo check --all-targets --locked
|