Skip to content

Commit f182a3a

Browse files
authored
Merge pull request #306 from automagik-dev/fix/sccache-incremental
fix(ci): disable incremental compilation for sccache
2 parents de1be6e + e52863d commit f182a3a

2 files changed

Lines changed: 48 additions & 13 deletions

File tree

.github/workflows/build-all-platforms.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ jobs:
4040
- os: [self-hosted, Linux, X64] # Self-hosted runner on ct200 with Docker
4141
target: x86_64-unknown-linux-gnu
4242
platform: linux-x64
43-
container: ghcr.io/namastexlabs/forge-builder:nightly-2025-12-04
43+
container_image: ghcr.io/namastexlabs/forge-builder:nightly-2025-12-04
4444
cargo_jobs: 20 # ct200 has 20 cores
4545
- os: [self-hosted, Linux, X64] # Self-hosted runner on ct200 with Docker (cross-compile)
4646
target: aarch64-unknown-linux-gnu
4747
platform: linux-arm64
4848
use-zigbuild: true
49-
container: ghcr.io/namastexlabs/forge-builder:nightly-2025-12-04
49+
container_image: ghcr.io/namastexlabs/forge-builder:nightly-2025-12-04
5050
cargo_jobs: 20 # ct200 has 20 cores
5151
# Android builds moved to separate workflow (build-android-apk.yml)
5252
- os: [self-hosted, Windows, X64] # Self-hosted runner on ct201
@@ -67,7 +67,7 @@ jobs:
6767
cargo_jobs: 3 # GitHub-hosted M1 has 3 cores
6868

6969
runs-on: ${{ matrix.os }}
70-
container: ${{ matrix.container }}
70+
container: ${{ matrix.container_image || '' }}
7171

7272
steps:
7373
- uses: actions/checkout@v4
@@ -128,6 +128,7 @@ jobs:
128128
run: |
129129
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
130130
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
131+
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV # sccache doesn't work with incremental compilation
131132
132133
- name: Cache Rust dependencies
133134
if: env.SKIP_BUILD != 'true'
@@ -359,6 +360,13 @@ jobs:
359360
path: npx-cli/dist/${{ matrix.platform }}/
360361
overwrite: true
361362

363+
# Fix file ownership for subsequent jobs on self-hosted runners
364+
# Docker containers run as root, creating root-owned files that the runner user can't clean up
365+
- name: Fix file ownership (Linux containers)
366+
if: always() && matrix.container_image
367+
shell: bash
368+
run: chown -R 1000:1000 $GITHUB_WORKSPACE || true
369+
362370
# Android builds moved to separate workflow: build-android-apk.yml
363371
# This allows Android to have its own release timeline
364372

.github/workflows/release.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,30 +189,57 @@ jobs:
189189
git push origin HEAD
190190
git push origin --tags
191191
192-
- name: Create matching forge-core tag
192+
- name: Sync forge-core version and create tag
193193
if: needs.gate.outputs.action != 'promote'
194194
continue-on-error: true
195195
env:
196196
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
197197
run: |
198+
VERSION="${{ steps.bump.outputs.version }}"
198199
TAG="${{ steps.bump.outputs.tag }}"
199-
echo "Creating tag $TAG in namastexlabs/forge-core..."
200-
201-
# Get main branch SHA from forge-core
202-
SHA=$(gh api repos/namastexlabs/forge-core/git/refs/heads/main --jq '.object.sha')
200+
echo "Syncing forge-core to version $VERSION and creating tag $TAG..."
203201
204202
# Check if tag already exists
205203
if gh api repos/namastexlabs/forge-core/git/refs/tags/$TAG 2>/dev/null; then
206204
echo "Tag $TAG already exists in forge-core, skipping"
207205
exit 0
208206
fi
209207
210-
# Create the tag reference
211-
gh api repos/namastexlabs/forge-core/git/refs \
212-
-f ref="refs/tags/$TAG" \
213-
-f sha="$SHA"
208+
# Trigger sync-version-from-forge workflow which:
209+
# 1. Updates [workspace.package] version in Cargo.toml using cargo set-version
210+
# 2. Commits the change
211+
# 3. Creates an annotated tag pointing at the versioned commit
212+
echo "Triggering sync-version-from-forge workflow..."
213+
gh workflow run sync-version-from-forge.yml \
214+
--repo namastexlabs/forge-core \
215+
-f version="$VERSION"
216+
217+
# Wait for workflow to start and complete
218+
echo "Waiting for sync workflow to complete..."
219+
sleep 15
220+
221+
# Poll for workflow completion (max 2 minutes)
222+
for i in {1..24}; do
223+
STATUS=$(gh run list --repo namastexlabs/forge-core \
224+
--workflow=sync-version-from-forge.yml \
225+
--limit=1 --json status,conclusion \
226+
--jq '.[0] | "\(.status) \(.conclusion)"')
227+
228+
echo "Attempt $i: $STATUS"
229+
230+
if [[ "$STATUS" == "completed success" ]]; then
231+
echo "✅ forge-core version synced and tag $TAG created"
232+
exit 0
233+
elif [[ "$STATUS" == "completed failure" ]] || [[ "$STATUS" == "completed cancelled" ]]; then
234+
echo "❌ Sync workflow failed: $STATUS"
235+
exit 1
236+
fi
237+
238+
sleep 5
239+
done
214240
215-
echo "Created forge-core tag $TAG at $SHA"
241+
echo "⚠️ Timed out waiting for sync workflow"
242+
exit 1
216243
217244
# Build (skip for promote action)
218245
build:

0 commit comments

Comments
 (0)