4242 run : cargo test --workspace --lib
4343
4444 # ───────────────────────────────────────────────
45- # Publish crates to crates.io (core first, then server)
45+ # Publish a3s-code-core to crates.io
4646 # ───────────────────────────────────────────────
4747 publish-crate :
4848 name : Publish to crates.io
@@ -66,150 +66,6 @@ jobs:
6666 CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_TOKEN }}
6767 run : cargo publish --allow-dirty || true
6868
69- - name : Wait for crates.io index
70- run : sleep 30
71-
72- - name : Publish a3s-code
73- working-directory : server
74- env :
75- CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_TOKEN }}
76- run : cargo publish --allow-dirty || true
77-
78- # ───────────────────────────────────────────────
79- # Build server binary for 4 platforms
80- # ───────────────────────────────────────────────
81- build-server :
82- name : Server / ${{ matrix.name }}
83- needs : ci
84- strategy :
85- fail-fast : false
86- matrix :
87- include :
88- - target : aarch64-apple-darwin
89- os : macos-latest
90- name : darwin-arm64
91- - target : x86_64-apple-darwin
92- os : macos-latest
93- name : darwin-x86_64
94- - target : x86_64-unknown-linux-gnu
95- os : ubuntu-latest
96- name : linux-x86_64
97- - target : aarch64-unknown-linux-gnu
98- os : ubuntu-latest
99- name : linux-arm64
100- cross : true
101-
102- runs-on : ${{ matrix.os }}
103-
104- steps :
105- - uses : actions/checkout@v4
106-
107- - name : Setup workspace context
108- run : bash .github/setup-workspace.sh
109-
110- - name : Install Rust
111- uses : dtolnay/rust-toolchain@stable
112- with :
113- targets : ${{ matrix.target }}
114-
115- - name : Install protobuf compiler
116- shell : bash
117- run : |
118- if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
119- sudo apt-get update && sudo apt-get install -y protobuf-compiler
120- else
121- brew install protobuf
122- fi
123-
124- - name : Install cross-compilation tools
125- if : matrix.cross
126- run : |
127- sudo apt-get update
128- sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
129- echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
130-
131- - name : Build
132- run : cargo build --release --target ${{ matrix.target }} -p a3s-code
133-
134- - name : Strip binary
135- shell : bash
136- run : |
137- BINARY="target/${{ matrix.target }}/release/a3s-code"
138- if [ "${{ matrix.cross }}" = "true" ]; then
139- aarch64-linux-gnu-strip "$BINARY" || true
140- else
141- strip "$BINARY" || true
142- fi
143-
144- - name : Package
145- shell : bash
146- run : |
147- VERSION="${GITHUB_REF_NAME#v}"
148- ARCHIVE="a3s-code-${VERSION}-${{ matrix.name }}.tar.gz"
149- tar -czf "$ARCHIVE" -C "target/${{ matrix.target }}/release" a3s-code
150- echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
151-
152- - name : Upload artifact
153- uses : actions/upload-artifact@v4
154- with :
155- name : server-${{ matrix.name }}
156- path : ${{ env.ARCHIVE }}
157-
158- # ───────────────────────────────────────────────
159- # Publish Python gRPC SDK to PyPI
160- # ───────────────────────────────────────────────
161- publish-python-grpc :
162- name : Python gRPC SDK
163- needs : ci
164- runs-on : ubuntu-latest
165- steps :
166- - uses : actions/checkout@v4
167-
168- - uses : actions/setup-python@v5
169- with :
170- python-version : " 3.12"
171-
172- - name : Install build tools
173- run : pip install build twine
174-
175- - name : Build package
176- working-directory : sdk/python
177- run : python -m build
178-
179- - name : Publish to PyPI
180- working-directory : sdk/python
181- env :
182- TWINE_USERNAME : __token__
183- TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
184- run : twine upload --skip-existing dist/*
185-
186- # ───────────────────────────────────────────────
187- # Publish TypeScript gRPC SDK to npm
188- # ───────────────────────────────────────────────
189- publish-typescript-grpc :
190- name : TypeScript gRPC SDK
191- needs : ci
192- runs-on : ubuntu-latest
193- steps :
194- - uses : actions/checkout@v4
195-
196- - uses : actions/setup-node@v4
197- with :
198- node-version : 20
199- registry-url : https://registry.npmjs.org
200-
201- - name : Install & build
202- working-directory : sdk/typescript
203- run : |
204- npm ci
205- npm run build
206-
207- - name : Publish to npm
208- working-directory : sdk/typescript
209- env :
210- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
211- run : npm publish --access public || true
212-
21369 # ───────────────────────────────────────────────
21470 # Build and publish Node native SDK (reusable)
21571 # ───────────────────────────────────────────────
@@ -229,30 +85,17 @@ jobs:
22985 secrets : inherit
23086
23187 # ───────────────────────────────────────────────
232- # Create GitHub Release with server binaries
88+ # Create GitHub Release
23389 # ───────────────────────────────────────────────
23490 github-release :
23591 name : GitHub Release
236- needs : [ci, build-server]
92+ needs : ci
23793 runs-on : ubuntu-latest
23894 steps :
23995 - uses : actions/checkout@v4
24096 with :
24197 fetch-depth : 0
24298
243- - name : Download server artifacts
244- uses : actions/download-artifact@v4
245- with :
246- pattern : server-*
247- path : artifacts
248- merge-multiple : true
249-
250- - name : Generate checksums
251- run : |
252- cd artifacts
253- sha256sum *.tar.gz > checksums.txt
254- cat checksums.txt
255-
25699 - name : Generate release notes
257100 run : |
258101 PREV_TAG=$(git tag --sort=-v:refname | grep '^v' | head -2 | tail -1)
@@ -262,123 +105,14 @@ jobs:
262105 git log "${PREV_TAG}..HEAD" --oneline --no-merges --pretty=format:"- %s" | head -50 > /tmp/release-notes.md
263106 fi
264107
265- - name : Create or update release
108+ - name : Create release
266109 env :
267110 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
268111 run : |
269112 if gh release view "$GITHUB_REF_NAME" &>/dev/null; then
270- gh release upload "$GITHUB_REF_NAME" \
271- artifacts/*.tar.gz artifacts/checksums.txt --clobber
113+ echo "Release $GITHUB_REF_NAME already exists"
272114 else
273115 gh release create "$GITHUB_REF_NAME" \
274116 --title "$GITHUB_REF_NAME" \
275- --notes-file /tmp/release-notes.md \
276- artifacts/*.tar.gz artifacts/checksums.txt
117+ --notes-file /tmp/release-notes.md
277118 fi
278-
279- # ───────────────────────────────────────────────
280- # Update Homebrew formula in homebrew-tap
281- # ───────────────────────────────────────────────
282- update-homebrew :
283- name : Update Homebrew
284- needs : github-release
285- runs-on : ubuntu-latest
286- steps :
287- - name : Download server artifacts
288- uses : actions/download-artifact@v4
289- with :
290- pattern : server-*
291- path : artifacts
292- merge-multiple : true
293-
294- - name : Compute SHA256 hashes
295- id : sha
296- run : |
297- VERSION="${GITHUB_REF_NAME#v}"
298- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
299- for platform in darwin-arm64 darwin-x86_64 linux-arm64 linux-x86_64; do
300- FILE="artifacts/a3s-code-${VERSION}-${platform}.tar.gz"
301- if [ -f "$FILE" ]; then
302- HASH=$(sha256sum "$FILE" | awk '{print $1}')
303- KEY=$(echo "$platform" | tr '-' '_')
304- echo "${KEY}=$HASH" >> "$GITHUB_OUTPUT"
305- echo "$platform: $HASH"
306- else
307- echo "Warning: $FILE not found"
308- fi
309- done
310-
311- - name : Checkout homebrew-tap
312- uses : actions/checkout@v4
313- with :
314- repository : A3S-Lab/homebrew-tap
315- token : ${{ secrets.HOMEBREW_TAP_TOKEN }}
316- path : homebrew-tap
317-
318- - name : Update formula
319- env :
320- VERSION : ${{ steps.sha.outputs.version }}
321- SHA_DARWIN_ARM64 : ${{ steps.sha.outputs.darwin_arm64 }}
322- SHA_DARWIN_X86_64 : ${{ steps.sha.outputs.darwin_x86_64 }}
323- SHA_LINUX_ARM64 : ${{ steps.sha.outputs.linux_arm64 }}
324- SHA_LINUX_X86_64 : ${{ steps.sha.outputs.linux_x86_64 }}
325- run : |
326- cat > homebrew-tap/Formula/a3s-code.rb <<'FORMULA'
327- class A3sCode < Formula
328- desc "AI coding agent with tool execution and gRPC service"
329- homepage "https://github.com/A3S-Lab/Code"
330- version "VERSION_PLACEHOLDER"
331- license "MIT"
332-
333- on_macos do
334- on_arm do
335- url "https://github.com/A3S-Lab/Code/releases/download/vVERSION_PLACEHOLDER/a3s-code-VERSION_PLACEHOLDER-darwin-arm64.tar.gz"
336- sha256 "SHA_DARWIN_ARM64_PLACEHOLDER"
337- end
338- on_intel do
339- url "https://github.com/A3S-Lab/Code/releases/download/vVERSION_PLACEHOLDER/a3s-code-VERSION_PLACEHOLDER-darwin-x86_64.tar.gz"
340- sha256 "SHA_DARWIN_X86_64_PLACEHOLDER"
341- end
342- end
343-
344- on_linux do
345- on_arm do
346- url "https://github.com/A3S-Lab/Code/releases/download/vVERSION_PLACEHOLDER/a3s-code-VERSION_PLACEHOLDER-linux-arm64.tar.gz"
347- sha256 "SHA_LINUX_ARM64_PLACEHOLDER"
348- end
349- on_intel do
350- url "https://github.com/A3S-Lab/Code/releases/download/vVERSION_PLACEHOLDER/a3s-code-VERSION_PLACEHOLDER-linux-x86_64.tar.gz"
351- sha256 "SHA_LINUX_X86_64_PLACEHOLDER"
352- end
353- end
354-
355- def install
356- bin.install "a3s-code"
357- end
358-
359- test do
360- assert_match "a3s-code", shell_output("#{bin}/a3s-code --version")
361- end
362- end
363- FORMULA
364-
365- sed -i 's/^ //' homebrew-tap/Formula/a3s-code.rb
366- sed -i "s/VERSION_PLACEHOLDER/${VERSION}/g" homebrew-tap/Formula/a3s-code.rb
367- sed -i "s/SHA_DARWIN_ARM64_PLACEHOLDER/${SHA_DARWIN_ARM64}/g" homebrew-tap/Formula/a3s-code.rb
368- sed -i "s/SHA_DARWIN_X86_64_PLACEHOLDER/${SHA_DARWIN_X86_64}/g" homebrew-tap/Formula/a3s-code.rb
369- sed -i "s/SHA_LINUX_ARM64_PLACEHOLDER/${SHA_LINUX_ARM64}/g" homebrew-tap/Formula/a3s-code.rb
370- sed -i "s/SHA_LINUX_X86_64_PLACEHOLDER/${SHA_LINUX_X86_64}/g" homebrew-tap/Formula/a3s-code.rb
371-
372- cat homebrew-tap/Formula/a3s-code.rb
373-
374- - name : Commit and push
375- working-directory : homebrew-tap
376- env :
377- VERSION : ${{ steps.sha.outputs.version }}
378- run : |
379- git config user.name "github-actions[bot]"
380- git config user.email "github-actions[bot]@users.noreply.github.com"
381- git add Formula/a3s-code.rb
382- git diff --cached --quiet && echo "No changes" && exit 0
383- git commit -m "a3s-code: update to ${VERSION}"
384- git push
0 commit comments