Files
openswarm/.github/workflows/promotion-gate.yml
T

58 lines
2.2 KiB
YAML

name: Promotion gate (update feeds agree)
# The "don't let a half-baked release become latest" gate. Releases should be
# cut as DRAFT first (publish.sh drafts experimental builds; do the same for
# stable and only un-draft after dogfooding — see docs/RELEASE_CHECKLIST.md).
# When a release is published / un-drafted, this verifies BOTH auto-updater
# feeds exist, agree on version (with each other and the tag), and that every
# referenced asset actually resolves (HEAD 200). If a platform's feed is
# missing or versions mismatch, this goes red so the bad release is caught
# before users auto-update into it.
# Release events fire in the repo that HOLDS the releases: the public shell (openswarm-ai/openswarm).
# The copy that answers them lives in release-shell/.github/workflows/promotion-gate.yml and is pushed
# by scripts/release/sync-shell.sh; this one is the by-hand form for the repo that builds.
on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag to verify (e.g. v1.2.3)'
required: true
permissions:
contents: read
jobs:
verify-feeds:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.18.1'
- name: Resolve tag
id: tag
shell: bash
run: |
tag="${{ github.event.release.tag_name }}"
[ -z "$tag" ] && tag="${{ github.event.inputs.tag }}"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "ver=${tag#v}" >> "$GITHUB_OUTPUT"
- name: Download release feeds
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
mkdir -p feeds
gh release download "${{ steps.tag.outputs.tag }}" --repo openswarm-ai/openswarm \
-p 'latest*.yml' -D feeds || true
ls -la feeds
- name: Verify both feeds exist, agree, and resolve
shell: bash
run: |
node scripts/release/verify-release.js \
--dir feeds \
--expect-version "${{ steps.tag.outputs.ver }}" \
--base-url "https://github.com/openswarm-ai/openswarm/releases/download/${{ steps.tag.outputs.tag }}"