2
0

fix: wait for release assets before triggering vault rebuild
All checks were successful
Build and Release / Create Release (push) Successful in 1s
Build and Release / Unit Tests (push) Successful in 3m0s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 4m56s
Build and Release / Lint (push) Successful in 5m11s
Build and Release / Build Binaries (amd64, darwin, linux-latest) (push) Successful in 2m29s
Build and Release / Build Binaries (arm64, darwin, linux-latest) (push) Successful in 3m19s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 4m15s
Build and Release / Build Binaries (arm64, linux, linux-latest) (push) Successful in 2m24s
Trigger Vault Plugin Rebuild / Trigger Vault Rebuild (push) Successful in 11m33s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 9h6m42s

Poll the release API until all server binaries are uploaded before
triggering the vault plugin rebuild. This ensures the vault builds
against the fully-released server version.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-17 18:53:31 -05:00
parent f59824ecaa
commit 699622753f

View File

@@ -1,10 +1,9 @@
name: Trigger Vault Plugin Rebuild
on:
workflow_run:
workflows: ["Build and Release"]
types:
- completed
push:
tags:
- 'v*'
env:
VAULT_REPO: gitcaddy/gitcaddy-vault
@@ -13,16 +12,37 @@ jobs:
trigger-vault:
name: Trigger Vault Rebuild
runs-on: linux-latest
if: >-
github.event.workflow_run.conclusion == 'success' &&
startsWith(github.event.workflow_run.head_branch, 'v')
steps:
- name: Wait for release assets
run: |
TAG="${{ github.ref_name }}"
echo "Waiting for server $TAG release to have all assets..."
# Wait up to 20 minutes for 10 assets (5 binaries + 5 checksums)
for i in $(seq 1 40); do
ASSETS=$(curl -sf \
-H "Authorization: token ${{ secrets.VAULT_DISPATCH_TOKEN }}" \
"https://direct.git.marketally.com/api/v1/repos/${{ github.repository }}/releases/tags/$TAG" \
| grep -o '"name":' | wc -l || echo "0")
echo "Attempt $i: Found $ASSETS assets"
if [ "$ASSETS" -ge 10 ]; then
echo "Release has all assets, proceeding..."
exit 0
fi
sleep 30
done
echo "Timeout waiting for release assets"
exit 1
- name: Trigger vault rebuild
run: |
TAG="${{ github.event.workflow_run.head_branch }}"
TAG="${{ github.ref_name }}"
echo "Triggering vault rebuild for server $TAG"
# Use workflow_dispatch API
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
-H "Authorization: token ${{ secrets.VAULT_DISPATCH_TOKEN }}" \
-H "Content-Type: application/json" \