Files
mistralrs-package/.gitea/workflows/poll-upstream.yml
rob thijssen f4e1008684 feat(ci): parameterize fedora version across pipeline
Add fedora_version to build, package, and publish matrices so the
pipeline can target multiple Fedora releases in parallel. Force the
dist tag via --define to ensure RPMs are stamped correctly regardless
of build host. Update poll-upstream to check all fedora/flavour
combinations before triggering a build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-26 14:36:09 +03:00

64 lines
2.2 KiB
YAML

name: poll-upstream
on:
schedule:
- cron: "*/15 * * * *"
workflow_dispatch: {}
concurrency:
group: poll-and-build
cancel-in-progress: false
jobs:
check:
runs-on: fedora
steps:
- name: Get upstream latest tag
id: upstream
run: |
tag=$(curl -sSfL \
-H 'Accept: application/vnd.github+json' \
https://api.github.com/repos/EricLBuehler/mistral.rs/releases/latest \
| jq -r .tag_name)
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
echo "Upstream latest: ${tag}"
- name: Check if all packages are published
id: published
run: |
version="${UPSTREAM_TAG#v}"
needs_build=false
for target in "43:cuda13"; do
fedora_version="${target%%:*}"
flavour="${target##*:}"
url="https://rpm.lair.cafe/fedora/${fedora_version}/x86_64/mistralrs-server-${flavour}-${version}-1.fc${fedora_version}.x86_64.rpm"
http_code=$(curl \
--silent \
--write-out "%{http_code}" \
--output /dev/null \
--head \
--url "${url}")
if [ "${http_code}" = "200" ]; then
echo "found: ${url}"
elif [ "${http_code}" = "404" ]; then
echo "missing: ${url}"
needs_build=true
else
echo "unexpected HTTP ${http_code} for ${url}"
exit 1
fi
done
echo "already_built=$( [ "${needs_build}" = "true" ] && echo false || echo true )" >> "$GITHUB_OUTPUT"
env:
UPSTREAM_TAG: ${{ steps.upstream.outputs.tag }}
- name: Trigger build workflow
if: steps.published.outputs.already_built == 'false'
run: |
curl --fail --silent --show-error --location \
--request POST \
--header "Authorization: token ${{ secrets.DISPATCH_TOKEN }}" \
--header 'Content-Type: application/json' \
--url "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/workflows/build-release.yml/dispatches" \
--data "{\"ref\":\"refs/heads/main\",\"inputs\":{\"tag\":\"${{ steps.upstream.outputs.tag }}\"}}"