Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 138 additions & 74 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ jobs:

# ── Release 构建 ──

# Linux GNU (glibc)
build-linux:
name: Build Release (Linux GNU)
# Linux Full (glibc + TLS + AI)
build-linux-full:
name: Build Release Linux (Full)
runs-on: ubuntu-latest
needs: [check, clippy, test-linux, smoke-linux]
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -124,57 +124,45 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --release -p agit-cli --all-features --verbose
- run: |
mkdir -p release
cp target/release/agit release/agit
cp LICENSE release/LICENSE
tar -czf agit-linux-x86_64.tar.gz -C release .
cp target/release/agit agit-linux-x86_64
mkdir -p release-full
cp target/release/agit release-full/agit
cp LICENSE release-full/LICENSE
tar -czf agit-full-linux-x86_64.tar.gz -C release-full .
cp target/release/agit agit-full-linux-x86_64
- name: Build .deb package
run: |
cargo install cargo-deb --locked
cargo deb --no-build -p agit-cli
cp target/debian/*.deb agit-linux-x86_64.deb 2>/dev/null || true
cp target/debian/*.deb agit-full-linux-x86_64.deb 2>/dev/null || true
- uses: actions/upload-artifact@v4
with:
name: agit-linux-x86_64
name: agit-full-linux-x86_64
path: |
agit-linux-x86_64.tar.gz
agit-linux-x86_64
agit-linux-x86_64.deb
agit-full-linux-x86_64.tar.gz
agit-full-linux-x86_64
agit-full-linux-x86_64.deb
retention-days: 30

# Linux musl (静态链接) — 暂时禁用,需 Linux 测试环境
# TODO: musl 交叉编译需要 ring crate 的 C 编译器配置,当前缺少 musl-gcc 工具链
# build-linux-musl:
# name: Build Release (Linux musl)
# runs-on: ubuntu-latest
# needs: [check, clippy, test-linux, smoke-linux]
# if: startsWith(github.ref, 'refs/tags/v')
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@stable
# with:
# targets: x86_64-unknown-linux-musl
# - name: Install musl-tools
# run: sudo apt-get update && sudo apt-get install -y musl-tools
# - run: cargo build --release -p agit-cli --all-features --verbose --target x86_64-unknown-linux-musl
# - run: |
# mkdir -p release-musl
# cp target/x86_64-unknown-linux-musl/release/agit release-musl/agit
# cp LICENSE release-musl/LICENSE
# tar -czf agit-linux-musl-x86_64.tar.gz -C release-musl .
# cp target/x86_64-unknown-linux-musl/release/agit agit-linux-musl-x86_64
# - uses: actions/upload-artifact@v4
# with:
# name: agit-linux-musl-x86_64
# path: |
# agit-linux-musl-x86_64.tar.gz
# agit-linux-musl-x86_64
# retention-days: 30
# Linux Lite (纯本地,无 TLS/AI)
build-linux-lite:
name: Build Release Linux (Lite)
runs-on: ubuntu-latest
needs: [check, clippy, test-linux, smoke-linux]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --release -p agit-cli --no-default-features -F tag --verbose
- run: cp target/release/agit agit-lite-linux-x86_64
- uses: actions/upload-artifact@v4
with:
name: agit-lite-linux-x86_64
path: agit-lite-linux-x86_64
retention-days: 30

# Windows
build-windows:
name: Build Release (Windows)
# Windows Full
build-windows-full:
name: Build Release Windows (Full)
runs-on: windows-latest
needs: [check, clippy, test-windows, smoke-windows]
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -184,22 +172,40 @@ jobs:
- run: cargo build --release -p agit-cli --all-features --verbose
- shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path release | Out-Null
Copy-Item target/release/agit.exe release/agit.exe
Copy-Item LICENSE release/LICENSE
Compress-Archive -Path release/* -DestinationPath agit-windows-x86_64.zip -Force
Copy-Item target/release/agit.exe agit-windows-x86_64.exe
New-Item -ItemType Directory -Force -Path release-full | Out-Null
Copy-Item target/release/agit.exe release-full/agit.exe
Copy-Item LICENSE release-full/LICENSE
Compress-Archive -Path release-full/* -DestinationPath agit-full-windows-x86_64.zip -Force
Copy-Item target/release/agit.exe agit-full-windows-x86_64.exe
- uses: actions/upload-artifact@v4
with:
name: agit-windows-x86_64
name: agit-full-windows-x86_64
path: |
agit-windows-x86_64.zip
agit-windows-x86_64.exe
agit-full-windows-x86_64.zip
agit-full-windows-x86_64.exe
retention-days: 30

# macOS
build-macos:
name: Build Release (macOS)
# Windows Lite
build-windows-lite:
name: Build Release Windows (Lite)
runs-on: windows-latest
needs: [check, clippy, test-windows, smoke-windows]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --release -p agit-cli --no-default-features -F tag --verbose
- shell: pwsh
run: Copy-Item target/release/agit.exe agit-lite-windows-x86_64.exe
- uses: actions/upload-artifact@v4
with:
name: agit-lite-windows-x86_64
path: agit-lite-windows-x86_64.exe
retention-days: 30

# macOS Full
build-macos-full:
name: Build Release macOS (Full)
runs-on: macos-latest
needs: [check, clippy, test-macos]
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -208,42 +214,100 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --release -p agit-cli --all-features --verbose
- run: |
mkdir -p release-macos
cp target/release/agit release-macos/agit
cp LICENSE release-macos/LICENSE
tar -czf agit-macos-x86_64.tar.gz -C release-macos .
cp target/release/agit agit-macos-x86_64
mkdir -p release-full
cp target/release/agit release-full/agit
cp LICENSE release-full/LICENSE
tar -czf agit-full-macos-x86_64.tar.gz -C release-full .
cp target/release/agit agit-full-macos-x86_64
- uses: actions/upload-artifact@v4
with:
name: agit-macos-x86_64
name: agit-full-macos-x86_64
path: |
agit-macos-x86_64.tar.gz
agit-macos-x86_64
agit-full-macos-x86_64.tar.gz
agit-full-macos-x86_64
retention-days: 30

# macOS Lite
build-macos-lite:
name: Build Release macOS (Lite)
runs-on: macos-latest
needs: [check, clippy, test-macos]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --release -p agit-cli --no-default-features -F tag --verbose
- run: cp target/release/agit agit-lite-macos-x86_64
- uses: actions/upload-artifact@v4
with:
name: agit-lite-macos-x86_64
path: agit-lite-macos-x86_64
retention-days: 30

# Linux musl (静态链接) — 暂时禁用
# build-linux-musl:
# name: Build Release Linux (musl static)
# runs-on: ubuntu-latest
# needs: [check, clippy, test-linux, smoke-linux]
# if: startsWith(github.ref, 'refs/tags/v')
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@stable
# with:
# targets: x86_64-unknown-linux-musl
# - name: Install musl-tools
# run: sudo apt-get update && sudo apt-get install -y musl-tools
# - run: cargo build --release -p agit-cli --all-features --verbose --target x86_64-unknown-linux-musl
# - run: |
# mkdir -p release-musl
# cp target/x86_64-unknown-linux-musl/release/agit release-musl/agit
# cp LICENSE release-musl/LICENSE
# tar -czf agit-linux-musl-x86_64.tar.gz -C release-musl .
# cp target/x86_64-unknown-linux-musl/release/agit agit-linux-musl-x86_64
# - uses: actions/upload-artifact@v4
# with:
# name: agit-linux-musl-x86_64
# path: |
# agit-linux-musl-x86_64.tar.gz
# agit-linux-musl-x86_64
# retention-days: 30

release:
name: GitHub Release
runs-on: ubuntu-latest
needs: [build-linux, build-windows, build-macos]
needs:
[build-linux-full, build-linux-lite, build-windows-full, build-windows-lite, build-macos-full, build-macos-lite]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
name: agit-linux-x86_64
name: agit-full-linux-x86_64
- uses: actions/download-artifact@v4
with:
name: agit-lite-linux-x86_64
- uses: actions/download-artifact@v4
with:
name: agit-full-windows-x86_64
- uses: actions/download-artifact@v4
with:
name: agit-lite-windows-x86_64
- uses: actions/download-artifact@v4
with:
name: agit-windows-x86_64
name: agit-full-macos-x86_64
- uses: actions/download-artifact@v4
with:
name: agit-macos-x86_64
name: agit-lite-macos-x86_64
- uses: softprops/action-gh-release@v2
with:
files: |
agit-linux-x86_64.tar.gz
agit-linux-x86_64
agit-linux-x86_64.deb
agit-windows-x86_64.zip
agit-windows-x86_64.exe
agit-macos-x86_64.tar.gz
agit-macos-x86_64
agit-full-linux-x86_64.tar.gz
agit-full-linux-x86_64
agit-full-linux-x86_64.deb
agit-lite-linux-x86_64
agit-full-windows-x86_64.zip
agit-full-windows-x86_64.exe
agit-lite-windows-x86_64.exe
agit-full-macos-x86_64.tar.gz
agit-full-macos-x86_64
agit-lite-macos-x86_64
generate_release_notes: true
35 changes: 20 additions & 15 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,31 @@ agit 提供两个版本,均从底层原生实现 Git 核心逻辑,无任何
#### 🪶 Lite 版本(单文件便携)
```bash
# Linux / macOS
curl -L https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-lite-x86_64-unknown-linux-musl -o agit
curl -L https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-lite-linux-x86_64 -o agit
chmod +x agit
./agit --help

# Windows (PowerShell)
Invoke-WebRequest -Uri https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-lite-windows-x86_64.exe -OutFile agit.exe
.\agit.exe --help

# 直接运行,无需安装
./agit init
```

#### 📦 Full 版本(安装包)
```bash
# Linux (.deb)
curl -LO https://github.com/bit-torch/AdapterGit/releases/latest/download/agit_0.1.0_amd64.deb
sudo dpkg -i agit_0.1.0_amd64.deb
curl -LO https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-full-linux-x86_64.deb
sudo dpkg -i agit-full-linux-x86_64.deb

# macOS (.dmg)
# 下载 .dmg 文件,双击安装即可
# macOS (.tar.gz)
curl -LO https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-full-macos-x86_64.tar.gz
tar -xzf agit-full-macos-x86_64.tar.gz && sudo cp agit /usr/local/bin/

# Windows (.msi)
# 下载 .msi 安装包,双击运行安装向导
# Windows (.zip)
Invoke-WebRequest -Uri https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-full-windows-x86_64.zip -OutFile agit-full.zip
Expand-Archive agit-full.zip
```

### 从源码构建
Expand Down Expand Up @@ -153,7 +159,7 @@ alias gai='agit --ai'
cargo install agit --features lite

# 或直接下载单文件
curl -L https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-lite -o agit
curl -L https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-lite-linux-x86_64 -o agit
chmod +x agit
sudo mv agit /usr/local/bin/ # 可选,移到 PATH
```
Expand All @@ -164,17 +170,16 @@ sudo mv agit /usr/local/bin/ # 可选,移到 PATH
cargo install agit

# Linux (deb)
sudo dpkg -i agit_0.1.0_amd64.deb

# Linux (rpm)
sudo rpm -i agit-0.1.0-1.x86_64.rpm
curl -LO https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-full-linux-x86_64.deb
sudo dpkg -i agit-full-linux-x86_64.deb

# macOS
# 下载 .dmg 双击安装,或使用 Homebrew:
brew install bit-torch/tap/agit
curl -LO https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-full-macos-x86_64.tar.gz
tar -xzf agit-full-macos-x86_64.tar.gz && sudo cp agit /usr/local/bin/

# Windows
# 下载 .msi 安装包,双击运行安装向导
Invoke-WebRequest -Uri https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-full-windows-x86_64.zip -OutFile agit-full.zip
Expand-Archive agit-full.zip
# 或使用 winget:
winget install bit-torch.agit
```
Expand Down
Loading
Loading