Skip to content

Commit 5931bba

Browse files
author
lijiuyang.5137
committed
Prepare cctty for open source release
1 parent df2e41c commit 5931bba

7 files changed

Lines changed: 477 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- master
9+
10+
jobs:
11+
test:
12+
name: Test (${{ matrix.os }})
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os:
18+
- ubuntu-latest
19+
- macos-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Install Rust
26+
uses: dtolnay/rust-toolchain@stable
27+
28+
- name: Cache cargo
29+
uses: Swatinem/rust-cache@v2
30+
31+
- name: Check formatting
32+
run: cargo fmt --all -- --check
33+
34+
- name: Test
35+
run: cargo test --locked

.github/workflows/release.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
name: Build ${{ matrix.target }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- os: ubuntu-latest
20+
target: x86_64-unknown-linux-gnu
21+
- os: macos-13
22+
target: x86_64-apple-darwin
23+
- os: macos-14
24+
target: aarch64-apple-darwin
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Install Rust
31+
uses: dtolnay/rust-toolchain@stable
32+
with:
33+
targets: ${{ matrix.target }}
34+
35+
- name: Cache cargo
36+
uses: Swatinem/rust-cache@v2
37+
38+
- name: Test
39+
run: cargo test --locked
40+
41+
- name: Build release binary
42+
run: cargo build --locked --release --target "${{ matrix.target }}"
43+
44+
- name: Package archive
45+
shell: bash
46+
run: |
47+
set -euo pipefail
48+
version="${GITHUB_REF_NAME#v}"
49+
archive="cctty-${version}-${{ matrix.target }}.tar.gz"
50+
mkdir -p "dist/${{ matrix.target }}"
51+
cp "target/${{ matrix.target }}/release/cctty" "dist/${{ matrix.target }}/"
52+
cp README.md LICENSE "dist/${{ matrix.target }}/"
53+
tar -C "dist/${{ matrix.target }}" -czf "dist/${archive}" cctty README.md LICENSE
54+
shasum -a 256 "dist/${archive}" > "dist/${archive}.sha256"
55+
56+
- name: Upload build artifact
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: cctty-${{ matrix.target }}
60+
path: |
61+
dist/*.tar.gz
62+
dist/*.sha256
63+
64+
publish:
65+
name: Publish GitHub release
66+
runs-on: ubuntu-latest
67+
needs: build
68+
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v4
72+
73+
- name: Download artifacts
74+
uses: actions/download-artifact@v4
75+
with:
76+
path: dist
77+
merge-multiple: true
78+
79+
- name: Generate Homebrew formula
80+
run: |
81+
bash scripts/generate-homebrew-formula.sh "${GITHUB_REPOSITORY}" "${GITHUB_REF_NAME}" dist > dist/cctty.rb
82+
83+
- name: Publish release
84+
env:
85+
GH_TOKEN: ${{ github.token }}
86+
run: |
87+
gh release create "${GITHUB_REF_NAME}" \
88+
dist/*.tar.gz \
89+
dist/*.sha256 \
90+
dist/cctty.rb \
91+
--title "cctty ${GITHUB_REF_NAME}" \
92+
--generate-notes

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
/target
1+
/target/
2+
/.DS_Store
3+
*.log
4+
*.tmp
5+
*.swp

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
name = "cctty"
33
version = "0.1.0"
44
edition = "2024"
5+
description = "Drop-in Claude Agent SDK runner backed by the interactive Claude TTY"
6+
license = "MIT"
7+
readme = "README.md"
8+
repository = "https://github.com/Pyiner/cctty"
9+
keywords = ["claude", "agent-sdk", "tty", "cli", "automation"]
10+
categories = ["command-line-utilities", "development-tools"]
511

612
[dependencies]
713
libc = "0.2"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 cctty contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)