Skip to content

Commit 2adaa91

Browse files
author
Test User
committed
fix(ci): musl cross builds, client wait gate, npm tag isolation
Add missing cross build step for musl targets, repair rustup perms on bigbox, fail on empty binary artifacts, detect client families in wait-for-client-binaries, stop npm workflow from v* tag releases, and use locked cargo build in Docker.
1 parent 9cf8894 commit 2adaa91

3 files changed

Lines changed: 53 additions & 21 deletions

File tree

.github/workflows/publish-npm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
default: 'latest'
2020
push:
2121
tags:
22-
- 'v*'
22+
# Monorepo server releases use bare v* tags; npm publishes on nodejs-v* only.
2323
- 'nodejs-v*'
2424

2525
permissions:
@@ -478,7 +478,7 @@ jobs:
478478
echo "GitHub Packages URL: https://github.com/terraphim/terraphim-ai/packages"
479479
480480
- name: Create GitHub Release
481-
if: startsWith(github.ref, 'refs/tags/') && inputs.dry_run != 'true'
481+
if: startsWith(github.ref, 'refs/tags/nodejs-') && inputs.dry_run != 'true'
482482
uses: softprops/action-gh-release@v2
483483
continue-on-error: true
484484
with:

.github/workflows/release-comprehensive.yml

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,17 @@ jobs:
133133
use_cross: false
134134

135135
runs-on: ${{ matrix.os }}
136+
env:
137+
CARGO_REGISTRIES_TERRAPHIM_TOKEN: ${{ secrets.CARGO_REGISTRIES_TERRAPHIM_TOKEN }}
136138
steps:
139+
- name: Repair rustup toolchain permissions (self-hosted)
140+
if: contains(matrix.os, 'self-hosted')
141+
run: |
142+
FIX="${HOME}/.local/bin/fix-rust-toolchain-perms.sh"
143+
if [[ -x "$FIX" ]]; then
144+
"$FIX" || true
145+
fi
146+
137147
- name: Cleanup self-hosted runner
138148
if: contains(matrix.os, 'self-hosted')
139149
run: |
@@ -205,22 +215,22 @@ jobs:
205215
key: ${{ matrix.os }}-${{ matrix.target }}
206216

207217
- name: Setup Node.js (for frontend build)
208-
if: "!matrix.use_cross"
218+
if: matrix.os != 'windows-latest'
209219
uses: actions/setup-node@v5
210220
with:
211221
node-version: 20
212222
cache: yarn
213223
cache-dependency-path: desktop/yarn.lock
214224

215225
- name: Build frontend assets
216-
if: "!matrix.use_cross"
226+
if: matrix.os != 'windows-latest'
217227
working-directory: ./desktop
218228
run: |
219229
yarn install --frozen-lockfile
220230
yarn build
221231
222232
- name: Copy frontend to server dist for rust-embed (Unix)
223-
if: "!matrix.use_cross && matrix.os != 'windows-latest'"
233+
if: matrix.os != 'windows-latest'
224234
run: |
225235
rm -r terraphim_server/dist/assets 2>/dev/null || true
226236
cp -a desktop/dist/. terraphim_server/dist/
@@ -256,12 +266,21 @@ jobs:
256266
shell: bash
257267
run: |
258268
# Clean to ensure fresh UI embedding
259-
cargo clean -p terraphim_server --target ${{ matrix.target }}
269+
rustup run stable cargo clean -p terraphim_server --target ${{ matrix.target }}
260270
261271
# Build with fresh UI
262-
cargo build --release \
272+
rustup run stable cargo build --release \
263273
--target ${{ matrix.target }} -p terraphim_server --bin terraphim_server
264274
275+
- name: Build server binary (cross / musl)
276+
if: matrix.use_cross
277+
shell: bash
278+
run: |
279+
rustup run stable cargo clean -p terraphim_server --target ${{ matrix.target }}
280+
rustup run stable cross build --release \
281+
--target ${{ matrix.target }} -p terraphim_server --bin terraphim_server
282+
ls -la "target/${{ matrix.target }}/release/terraphim_server"
283+
265284
- name: Verify binary versions (native builds only)
266285
if: matrix.target == 'x86_64-unknown-linux-gnu'
267286
shell: bash
@@ -285,14 +304,15 @@ jobs:
285304
VERSION: ${{ needs.verify-versions.outputs.version }}
286305
run: |
287306
mkdir -p artifacts
288-
# Create tar.gz archives with version in filename for auto-update compatibility
289-
# Server binary only exists for non-cross builds
290-
if [ -f "target/${{ matrix.target }}/release/terraphim_server" ]; then
291-
tar -czf "artifacts/terraphim_server-${VERSION}-${{ matrix.target }}.tar.gz" \
292-
-C "target/${{ matrix.target }}/release" terraphim_server
293-
cp target/${{ matrix.target }}/release/terraphim_server artifacts/terraphim_server-${{ matrix.target }}
294-
chmod +x artifacts/*
307+
BIN="target/${{ matrix.target }}/release/terraphim_server"
308+
if [ ! -f "$BIN" ]; then
309+
echo "::error::Missing server binary at $BIN"
310+
exit 1
295311
fi
312+
tar -czf "artifacts/terraphim_server-${VERSION}-${{ matrix.target }}.tar.gz" \
313+
-C "target/${{ matrix.target }}/release" terraphim_server
314+
cp "$BIN" "artifacts/terraphim_server-${{ matrix.target }}"
315+
chmod +x artifacts/*
296316
297317
- name: Prepare artifacts (Windows)
298318
if: matrix.os == 'windows-latest'
@@ -698,8 +718,11 @@ jobs:
698718
uses: softprops/action-gh-release@v2
699719
with:
700720
name: ${{ steps.release-notes.outputs.title }}
721+
tag_name: ${{ github.ref_name }}
701722
draft: false
702723
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
724+
overwrite: true
725+
make_latest: true
703726
files: release-assets/*
704727
body: |
705728
## Release Assets
@@ -759,17 +782,26 @@ jobs:
759782
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
760783
run: |
761784
TAG="${{ github.ref_name }}"
785+
# Require at least one asset matching each client binary family.
786+
REQUIRED_PATTERNS=('terraphim-agent' 'terraphim-cli' 'terraphim-grep')
762787
echo "Waiting for client binaries on release $TAG ..."
763-
for attempt in $(seq 1 60); do
764-
COUNT=$(gh release view "$TAG" --repo terraphim/terraphim-ai --json assets -q '.assets | length' 2>/dev/null || echo 0)
765-
echo "Attempt $attempt: $COUNT assets on release"
766-
if [ "$COUNT" -ge 8 ]; then
767-
echo "Client binaries appear present"
788+
for attempt in $(seq 1 120); do
789+
ASSETS=$(gh release view "$TAG" --repo terraphim/terraphim-ai --json assets -q '.assets[].name' 2>/dev/null || true)
790+
MISSING=0
791+
for pattern in "${REQUIRED_PATTERNS[@]}"; do
792+
if ! echo "$ASSETS" | grep -q "$pattern"; then
793+
echo " missing pattern: $pattern"
794+
MISSING=$((MISSING + 1))
795+
fi
796+
done
797+
echo "Attempt $attempt: missing $MISSING client families"
798+
if [ "$MISSING" -eq 0 ]; then
799+
echo "Client binaries present on release"
768800
exit 0
769801
fi
770802
sleep 30
771803
done
772-
echo "::error::Timed out waiting for terraphim-clients to attach binaries"
804+
echo "::error::Timed out waiting for terraphim-clients to attach agent/cli/grep binaries"
773805
exit 1
774806
775807
update-homebrew:

docker/Dockerfile.multiarch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ RUN --mount=type=secret,id=cargo_registry_token \
131131
export CARGO_REGISTRIES_TERRAPHIM_TOKEN="$(cat /run/secrets/cargo_registry_token)" && \
132132
. /root/.profile && \
133133
RUST_TARGET=$(cat /tmp/rust-target) && \
134-
cargo build --release --target=$RUST_TARGET --package terraphim_server
134+
cargo build --locked --release --target=$RUST_TARGET --package terraphim_server
135135

136136
# Test the binaries
137137
RUN . /root/.profile && \

0 commit comments

Comments
 (0)