Skip to content

Commit 1c70ee8

Browse files
committed
Implement config diffs, hook diagnostics, and CI/release pipelines
1 parent 2e8922e commit 1c70ee8

22 files changed

Lines changed: 2549 additions & 353 deletions

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
check:
11+
name: Check ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: dtolnay/rust-toolchain@stable
22+
with:
23+
components: rustfmt, clippy
24+
25+
- name: Install Linux deps
26+
if: runner.os == 'Linux'
27+
run: sudo apt-get update && sudo apt-get install -y pkg-config libgtk-3-dev libx11-dev libxi-dev libxkbcommon-dev libwayland-dev libgl1-mesa-dev libasound2-dev
28+
29+
- name: Format
30+
run: cargo fmt --check
31+
32+
- name: Clippy
33+
run: cargo clippy --all-targets -- -D warnings
34+
35+
- name: Test
36+
run: cargo test --locked

.github/workflows/release.yml

Lines changed: 67 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,95 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: 'Version number (e.g., 1.0.0)'
7+
description: Version without leading v, for example 1.0.0
88
required: true
9-
default: '1.0.0'
9+
draft:
10+
description: Create release as draft
11+
type: boolean
12+
default: false
13+
prerelease:
14+
description: Mark release as prerelease
15+
type: boolean
16+
default: false
1017

1118
permissions:
1219
contents: write
1320

1421
jobs:
15-
build-and-upload:
16-
name: Build for ${{ matrix.os }}
22+
build:
23+
name: Build ${{ matrix.name }}
1724
runs-on: ${{ matrix.os }}
1825
strategy:
26+
fail-fast: false
1927
matrix:
2028
include:
21-
- os: windows-latest
29+
- name: windows-x86_64
30+
os: windows-latest
2231
target: x86_64-pc-windows-msvc
23-
artifact_name: agent-switch.exe
24-
asset_name: agent-switch-windows-x86_64.exe
25-
- os: ubuntu-latest
32+
bin: agent-switch.exe
33+
asset: agent-switch-windows-x86_64.exe
34+
- name: linux-x86_64
35+
os: ubuntu-latest
2636
target: x86_64-unknown-linux-gnu
27-
artifact_name: agent-switch
28-
asset_name: agent-switch-linux-x86_64
29-
- os: macos-latest
37+
bin: agent-switch
38+
asset: agent-switch-linux-x86_64
39+
- name: macos-x86_64
40+
os: macos-13
41+
target: x86_64-apple-darwin
42+
bin: agent-switch
43+
asset: agent-switch-macos-x86_64
44+
- name: macos-aarch64
45+
os: macos-latest
3046
target: aarch64-apple-darwin
31-
artifact_name: agent-switch
32-
asset_name: agent-switch-macos-arm64
47+
bin: agent-switch
48+
asset: agent-switch-macos-aarch64
3349

3450
steps:
35-
- name: Checkout code
36-
uses: actions/checkout@v4
51+
- uses: actions/checkout@v4
3752

38-
- name: Install Rust
39-
uses: dtolnay/rust-toolchain@stable
53+
- uses: dtolnay/rust-toolchain@stable
4054
with:
4155
targets: ${{ matrix.target }}
4256

43-
- name: Install Linux dependencies
57+
- name: Install Linux deps
4458
if: runner.os == 'Linux'
45-
run: sudo apt-get update; sudo apt-get install -y libxkbcommon-dev libvulkan-dev libwayland-dev xorg-dev
59+
run: sudo apt-get update && sudo apt-get install -y pkg-config libgtk-3-dev libx11-dev libxi-dev libxkbcommon-dev libwayland-dev libgl1-mesa-dev libasound2-dev
4660

47-
- name: Build Release
48-
run: cargo build --release --target ${{ matrix.target }}
61+
- name: Test
62+
run: cargo test --locked
4963

50-
- name: Rename Artifact
64+
- name: Build release
65+
run: cargo build --locked --release --target ${{ matrix.target }}
66+
67+
- name: Stage asset
5168
shell: bash
52-
run: mv target/${{ matrix.target }}/release/${{ matrix.artifact_name }} ./${{ matrix.asset_name }}
69+
run: |
70+
mkdir -p dist
71+
cp "target/${{ matrix.target }}/release/${{ matrix.bin }}" "dist/${{ matrix.asset }}"
72+
73+
- uses: actions/upload-artifact@v4
74+
with:
75+
name: ${{ matrix.name }}
76+
path: dist/${{ matrix.asset }}
77+
if-no-files-found: error
78+
79+
publish:
80+
name: Publish GitHub Release
81+
needs: build
82+
runs-on: ubuntu-latest
83+
steps:
84+
- uses: actions/download-artifact@v4
85+
with:
86+
path: dist
87+
merge-multiple: true
88+
89+
- name: Checksums
90+
run: cd dist && sha256sum * > SHA256SUMS.txt
5391

54-
- name: Upload to GitHub Release
55-
uses: softprops/action-gh-release@v2
92+
- uses: softprops/action-gh-release@v2
5693
with:
57-
name: Release v${{ github.event.inputs.version }}
58-
tag_name: v${{ github.event.inputs.version }}
59-
files: ./${{ matrix.asset_name }}
60-
env:
61-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
tag_name: v${{ inputs.version }}
95+
name: AgentSwitch v${{ inputs.version }}
96+
draft: ${{ inputs.draft }}
97+
prerelease: ${{ inputs.prerelease }}
98+
files: dist/*

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
target/
2-
**/*.rs.bk
2+
dist/
3+
release/
34
*.pdb
45
*.bak
56
*.json.bak
7+
**/*.rs.bk
8+
69
.idea/
710
.vscode/
811
*.swp
912
*.swo
13+
14+
.env
15+
.env.*
16+
!.env.example
17+
18+
*.md
19+
!README.md

Cargo.lock

Lines changed: 32 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "agent-switch"
3-
version = "0.1.0"
3+
version = "1.1.0"
44
edition = "2021"
55
description = "Unified AI agent configuration manager"
66

@@ -9,6 +9,7 @@ eframe = "0.31"
99
egui = "0.31"
1010
serde = { version = "1", features = ["derive"] }
1111
serde_json = "1"
12+
toml = "1"
1213
walkdir = "2"
1314
anyhow = "1"
1415
dirs = "6"

0 commit comments

Comments
 (0)