Skip to content

Commit a62f45f

Browse files
authored
Merge pull request #109 from nikomatsakis/ci-binaries
Publish binaries to CI
2 parents 64e6921 + 80aaea7 commit a62f45f

File tree

3 files changed

+142
-0
lines changed

3 files changed

+142
-0
lines changed
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Release Binaries
2+
3+
on:
4+
push:
5+
tags:
6+
- "elizacp-v*"
7+
- "yopo-v*"
8+
- "sacp-conductor-v*"
9+
- "sacp-tee-v*"
10+
- "sacp-trace-viewer-v*"
11+
12+
env:
13+
CARGO_TERM_COLOR: always
14+
15+
jobs:
16+
build:
17+
name: Build ${{ matrix.binary }} for ${{ matrix.target }}
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
# x86_64
24+
- target: x86_64-unknown-linux-musl
25+
os: ubuntu-latest
26+
archive: tar.gz
27+
musl: true
28+
- target: x86_64-apple-darwin
29+
os: macos-latest
30+
archive: tar.gz
31+
- target: x86_64-pc-windows-msvc
32+
os: windows-latest
33+
archive: zip
34+
# aarch64
35+
- target: aarch64-unknown-linux-musl
36+
os: ubuntu-latest
37+
archive: tar.gz
38+
musl: true
39+
cross: true
40+
- target: aarch64-apple-darwin
41+
os: macos-latest
42+
archive: tar.gz
43+
- target: aarch64-pc-windows-msvc
44+
os: windows-latest
45+
archive: zip
46+
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v5
50+
51+
- name: Extract binary name and version from tag
52+
id: extract
53+
shell: bash
54+
run: |
55+
# Tag format: {binary}-v{version}
56+
TAG="${GITHUB_REF#refs/tags/}"
57+
BINARY="${TAG%-v*}"
58+
VERSION="${TAG#*-}"
59+
echo "tag=$TAG" >> $GITHUB_OUTPUT
60+
echo "binary=$BINARY" >> $GITHUB_OUTPUT
61+
echo "version=$VERSION" >> $GITHUB_OUTPUT
62+
echo "Extracted: binary=$BINARY, version=$VERSION"
63+
64+
- name: Install Rust toolchain
65+
uses: dtolnay/rust-toolchain@stable
66+
with:
67+
targets: ${{ matrix.target }}
68+
69+
- name: Install musl tools
70+
if: matrix.musl
71+
run: |
72+
sudo apt-get update
73+
sudo apt-get install -y musl-tools
74+
75+
- name: Install cross-compilation tools (Linux aarch64 musl)
76+
if: matrix.cross
77+
run: |
78+
# Install aarch64-linux-musl cross compiler
79+
curl -fsSL https://musl.cc/aarch64-linux-musl-cross.tgz | sudo tar -xzC /opt
80+
echo "/opt/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH
81+
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc" >> $GITHUB_ENV
82+
83+
- name: Build binary
84+
run: cargo build --release --package ${{ steps.extract.outputs.binary }} --target ${{ matrix.target }}
85+
86+
- name: Package (Unix)
87+
if: matrix.archive == 'tar.gz'
88+
shell: bash
89+
run: |
90+
BINARY="${{ steps.extract.outputs.binary }}"
91+
VERSION="${{ steps.extract.outputs.version }}"
92+
TARGET="${{ matrix.target }}"
93+
ARCHIVE_NAME="${BINARY}-${TARGET}-${VERSION}.tar.gz"
94+
95+
cd target/$TARGET/release
96+
tar -czvf "../../../$ARCHIVE_NAME" "$BINARY"
97+
cd ../../..
98+
echo "ARCHIVE_NAME=$ARCHIVE_NAME" >> $GITHUB_ENV
99+
100+
- name: Package (Windows)
101+
if: matrix.archive == 'zip'
102+
shell: pwsh
103+
run: |
104+
$BINARY = "${{ steps.extract.outputs.binary }}"
105+
$VERSION = "${{ steps.extract.outputs.version }}"
106+
$TARGET = "${{ matrix.target }}"
107+
$ARCHIVE_NAME = "${BINARY}-${TARGET}-${VERSION}.zip"
108+
109+
Compress-Archive -Path "target\$TARGET\release\$BINARY.exe" -DestinationPath $ARCHIVE_NAME
110+
echo "ARCHIVE_NAME=$ARCHIVE_NAME" >> $env:GITHUB_ENV
111+
112+
- name: Upload artifact
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: ${{ steps.extract.outputs.binary }}-${{ matrix.target }}
116+
path: ${{ env.ARCHIVE_NAME }}
117+
retention-days: 1
118+
119+
release:
120+
name: Upload to Release
121+
needs: build
122+
runs-on: ubuntu-latest
123+
permissions:
124+
contents: write
125+
steps:
126+
- name: Download all artifacts
127+
uses: actions/download-artifact@v4
128+
with:
129+
path: artifacts
130+
131+
- name: Upload to GitHub Release
132+
uses: softprops/action-gh-release@v2
133+
with:
134+
files: artifacts/**/*

src/sacp-conductor/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ repository = "https://github.com/symposium-dev/symposium-acp"
88
keywords = ["acp", "agent", "conductor", "ai"]
99
categories = ["development-tools"]
1010

11+
[[bin]]
12+
name = "sacp-conductor"
13+
path = "src/main.rs"
14+
1115
[features]
1216
test-support = []
1317

src/sacp-tee/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ repository = "https://github.com/symposium-dev/symposium-acp"
88
keywords = ["acp", "agent", "debugging", "proxy", "logging"]
99
categories = ["development-tools", "development-tools::debugging"]
1010

11+
[[bin]]
12+
name = "sacp-tee"
13+
path = "src/main.rs"
14+
1115
[dependencies]
1216
anyhow.workspace = true
1317
chrono.workspace = true

0 commit comments

Comments
 (0)