Skip to content

Commit 1da90b5

Browse files
authored
Merge branch 'Stack-Cairn:main' into main
2 parents 7054e63 + 5247ecb commit 1da90b5

28 files changed

Lines changed: 1014 additions & 25 deletions

File tree

.dockerignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.git
2+
.github
3+
.codex
4+
.claude
5+
.codex-artifacts
6+
.liveagent
7+
8+
**/node_modules
9+
**/dist
10+
**/target
11+
**/bin
12+
**/*.tsbuildinfo
13+
14+
logs
15+
*.log
16+
*.local
17+
.DS_Store
18+
.idea
19+
.vscode
20+
21+
cert
22+
workspace
23+
workspace.zip

.github/workflows/ci.yml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
env:
13+
NODE_VERSION: 22.17.1
14+
15+
jobs:
16+
gateway:
17+
name: Gateway
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions/setup-go@v5
23+
with:
24+
go-version-file: crates/agent-gateway/go.mod
25+
cache-dependency-path: crates/agent-gateway/go.sum
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ env.NODE_VERSION }}
30+
31+
- name: Install pnpm
32+
run: npm install -g pnpm@10.32.1
33+
34+
- name: Install protobuf toolchain
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y unzip
38+
curl -fsSL -o "$RUNNER_TEMP/protoc.zip" \
39+
https://github.com/protocolbuffers/protobuf/releases/download/v34.0/protoc-34.0-linux-x86_64.zip
40+
unzip -q "$RUNNER_TEMP/protoc.zip" -d "$RUNNER_TEMP/protoc"
41+
echo "$RUNNER_TEMP/protoc/bin" >> "$GITHUB_PATH"
42+
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.10
43+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1
44+
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
45+
46+
- name: Build embedded Gateway WebUI
47+
working-directory: crates/agent-gateway/web
48+
run: |
49+
pnpm install --frozen-lockfile
50+
pnpm build
51+
52+
- name: Check generated protobuf
53+
run: |
54+
make proto
55+
git diff --exit-code -- crates/agent-gateway/internal/proto/v1
56+
57+
- name: Test gateway
58+
working-directory: crates/agent-gateway
59+
run: go test ./...
60+
61+
gateway-docker:
62+
name: Gateway Docker Smoke
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- uses: docker/setup-buildx-action@v3
68+
69+
- name: Build Docker image
70+
uses: docker/build-push-action@v6
71+
with:
72+
context: .
73+
file: Dockerfile
74+
load: true
75+
tags: liveagent-gateway:ci
76+
cache-from: type=gha
77+
cache-to: type=gha,mode=max
78+
79+
- name: Smoke test container
80+
run: |
81+
set -euo pipefail
82+
docker run --rm -d \
83+
--name liveagent-gateway-smoke \
84+
-p 18080:8080 \
85+
-e LIVEAGENT_GATEWAY_TOKEN=ci-token \
86+
liveagent-gateway:ci
87+
trap 'docker rm -f liveagent-gateway-smoke >/dev/null 2>&1 || true' EXIT
88+
for _ in $(seq 1 30); do
89+
if curl -fsS http://127.0.0.1:18080/healthz | grep -q '"ok":true'; then
90+
exit 0
91+
fi
92+
sleep 1
93+
done
94+
docker logs liveagent-gateway-smoke
95+
exit 1
96+
97+
webui:
98+
name: Gateway WebUI
99+
runs-on: ubuntu-latest
100+
steps:
101+
- uses: actions/checkout@v4
102+
103+
- uses: actions/setup-node@v4
104+
with:
105+
node-version: ${{ env.NODE_VERSION }}
106+
107+
- name: Install pnpm
108+
run: npm install -g pnpm@10.32.1
109+
110+
- name: Install dependencies
111+
working-directory: crates/agent-gateway/web
112+
run: pnpm install --frozen-lockfile
113+
114+
- name: Build WebUI
115+
working-directory: crates/agent-gateway/web
116+
run: pnpm build
117+
118+
- name: Test WebUI modules
119+
working-directory: crates/agent-gateway
120+
run: node --test test/webui/*.test.mjs
121+
122+
gui:
123+
name: GUI
124+
runs-on: ubuntu-latest
125+
steps:
126+
- uses: actions/checkout@v4
127+
128+
- uses: actions/setup-node@v4
129+
with:
130+
node-version: ${{ env.NODE_VERSION }}
131+
132+
- name: Install pnpm
133+
run: npm install -g pnpm@10.32.1
134+
135+
- name: Install dependencies
136+
working-directory: crates/agent-gui
137+
run: pnpm install --frozen-lockfile
138+
139+
- name: Test frontend modules
140+
working-directory: crates/agent-gui
141+
run: pnpm test:frontend
142+
143+
tauri-rust:
144+
name: Tauri Rust Check
145+
runs-on: ubuntu-latest
146+
timeout-minutes: 20
147+
steps:
148+
- uses: actions/checkout@v4
149+
150+
- name: Install Tauri Linux dependencies
151+
run: |
152+
sudo apt-get update
153+
sudo apt-get install -y \
154+
protobuf-compiler \
155+
libwebkit2gtk-4.1-dev \
156+
libgtk-3-dev \
157+
libayatana-appindicator3-dev \
158+
librsvg2-dev
159+
160+
- uses: dtolnay/rust-toolchain@stable
161+
162+
- uses: Swatinem/rust-cache@v2
163+
with:
164+
workspaces: crates/agent-gui/src-tauri
165+
166+
- name: Check Tauri backend tests
167+
env:
168+
CARGO_TERM_COLOR: always
169+
run: cargo check --manifest-path crates/agent-gui/src-tauri/Cargo.toml --tests
170+
171+
whitespace:
172+
name: Diff Hygiene
173+
runs-on: ubuntu-latest
174+
steps:
175+
- uses: actions/checkout@v4
176+
- run: git diff --check
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
name: Desktop Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: Release tag to publish, for example v0.1.0
11+
required: true
12+
13+
permissions:
14+
contents: write
15+
16+
env:
17+
NODE_VERSION: 22.17.1
18+
19+
jobs:
20+
macos:
21+
name: macOS ${{ matrix.name }}
22+
runs-on: ${{ matrix.runner }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
include:
27+
- name: Intel
28+
runner: macos-13
29+
target: x86_64-apple-darwin
30+
suffix: x64
31+
- name: Apple Silicon
32+
runner: macos-14
33+
target: aarch64-apple-darwin
34+
suffix: aarch64
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
ref: ${{ github.event.inputs.tag || github.ref }}
39+
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version: ${{ env.NODE_VERSION }}
43+
44+
- name: Install pnpm
45+
run: npm install -g pnpm@10.32.1
46+
47+
- uses: dtolnay/rust-toolchain@stable
48+
with:
49+
targets: ${{ matrix.target }}
50+
51+
- name: Install protobuf compiler
52+
run: brew install protobuf
53+
54+
- uses: Swatinem/rust-cache@v2
55+
with:
56+
workspaces: crates/agent-gui/src-tauri
57+
58+
- name: Install frontend dependencies
59+
working-directory: crates/agent-gui
60+
run: pnpm install --frozen-lockfile
61+
62+
- name: Import Apple signing certificate
63+
env:
64+
APPLE_CERTIFICATE_P12_BASE64: ${{ secrets.APPLE_CERTIFICATE_P12_BASE64 }}
65+
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
66+
run: |
67+
set -euo pipefail
68+
test -n "$APPLE_CERTIFICATE_P12_BASE64"
69+
test -n "$APPLE_CERTIFICATE_PASSWORD"
70+
KEYCHAIN_PATH="$RUNNER_TEMP/liveagent-release.keychain-db"
71+
KEYCHAIN_PASSWORD="$(openssl rand -hex 24)"
72+
CERT_PATH="$RUNNER_TEMP/developer-id-application.p12"
73+
printf '%s' "$APPLE_CERTIFICATE_P12_BASE64" | base64 --decode > "$CERT_PATH"
74+
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
75+
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
76+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
77+
security import "$CERT_PATH" -P "$APPLE_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"
78+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
79+
security list-keychains -d user -s "$KEYCHAIN_PATH"
80+
security default-keychain -s "$KEYCHAIN_PATH"
81+
security find-identity -v -p codesigning "$KEYCHAIN_PATH"
82+
83+
- name: Store notarization profile
84+
env:
85+
APPLE_ID: ${{ secrets.APPLE_ID }}
86+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
87+
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
88+
run: |
89+
set -euo pipefail
90+
test -n "$APPLE_ID"
91+
test -n "$APPLE_TEAM_ID"
92+
test -n "$APPLE_APP_SPECIFIC_PASSWORD"
93+
xcrun notarytool store-credentials liveagent-notary \
94+
--apple-id "$APPLE_ID" \
95+
--team-id "$APPLE_TEAM_ID" \
96+
--password "$APPLE_APP_SPECIFIC_PASSWORD" \
97+
--validate
98+
99+
- name: Build signed and notarized DMG
100+
env:
101+
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
102+
DESKTOP_MACOS_TARGET: ${{ matrix.target }}
103+
run: make desktop-build-macos-release
104+
105+
- name: Stage macOS artifact
106+
env:
107+
RELEASE_TAG: ${{ github.event.inputs.tag || github.ref_name }}
108+
run: |
109+
set -euo pipefail
110+
mkdir -p dist
111+
dmg_path="$(find "target/${{ matrix.target }}/release/bundle/dmg" -maxdepth 1 -name 'LiveAgent_*.dmg' -print -quit)"
112+
test -n "$dmg_path"
113+
cp "$dmg_path" "dist/LiveAgent_${RELEASE_TAG}_${{ matrix.suffix }}.dmg"
114+
115+
- uses: actions/upload-artifact@v4
116+
with:
117+
name: liveagent-macos-${{ matrix.suffix }}
118+
path: dist/*.dmg
119+
if-no-files-found: error
120+
121+
windows:
122+
name: Windows x64
123+
runs-on: windows-latest
124+
steps:
125+
- uses: actions/checkout@v4
126+
with:
127+
ref: ${{ github.event.inputs.tag || github.ref }}
128+
129+
- uses: actions/setup-node@v4
130+
with:
131+
node-version: ${{ env.NODE_VERSION }}
132+
133+
- name: Install pnpm
134+
run: npm install -g pnpm@10.32.1
135+
136+
- uses: dtolnay/rust-toolchain@stable
137+
138+
- name: Install protobuf compiler
139+
run: |
140+
choco install protoc -y --no-progress
141+
"$env:ChocolateyInstall\lib\protoc\tools\bin" | Out-File -Append $env:GITHUB_PATH
142+
143+
- uses: Swatinem/rust-cache@v2
144+
with:
145+
workspaces: crates/agent-gui/src-tauri
146+
147+
- name: Install frontend dependencies
148+
working-directory: crates/agent-gui
149+
run: pnpm install --frozen-lockfile
150+
151+
- name: Build Windows bundles
152+
working-directory: crates/agent-gui
153+
run: pnpm tauri build --config src-tauri/tauri.windows.conf.json --target x86_64-pc-windows-msvc
154+
155+
- name: Stage Windows artifacts
156+
shell: bash
157+
run: |
158+
set -euo pipefail
159+
mkdir -p dist
160+
find target crates/agent-gui/src-tauri/target -type f \( -name '*.msi' -o -name '*.exe' \) -path '*bundle*' -exec cp {} dist/ \; 2>/dev/null || true
161+
test "$(find dist -type f | wc -l)" -gt 0
162+
163+
- uses: actions/upload-artifact@v4
164+
with:
165+
name: liveagent-windows-x64
166+
path: dist/*
167+
if-no-files-found: error
168+
169+
publish:
170+
name: Publish GitHub Release
171+
runs-on: ubuntu-latest
172+
needs:
173+
- macos
174+
- windows
175+
steps:
176+
- uses: actions/download-artifact@v4
177+
with:
178+
path: release-artifacts
179+
merge-multiple: true
180+
181+
- name: Publish assets
182+
env:
183+
GH_TOKEN: ${{ github.token }}
184+
RELEASE_TAG: ${{ github.event.inputs.tag || github.ref_name }}
185+
run: |
186+
set -euo pipefail
187+
gh release view "$RELEASE_TAG" >/dev/null 2>&1 || \
188+
gh release create "$RELEASE_TAG" --title "$RELEASE_TAG" --notes "Automated LiveAgent release."
189+
gh release upload "$RELEASE_TAG" release-artifacts/* --clobber

0 commit comments

Comments
 (0)