@@ -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