Files
mistralrs-package/.gitea/workflows/poll-upstream.yml
rob thijssen e6c2b4e402
All checks were successful
poll-upstream / check (push) Successful in 1s
fix(ci): prevent poll-upstream from cancelling in-progress builds
Poll was firing every minute, dispatching new builds that cancelled
the running one. Restore 15-minute cron interval and add shared
concurrency group across both workflows so new polls queue instead
of re-dispatching.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 13:15:34 +03:00

58 lines
2.1 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: Get published version from our repo
id: published
run: |
# Query our own dnf repo. If the version is there, we've already built it.
# Strip leading 'v' because RPM versions don't use it.
version="${UPSTREAM_TAG#v}"
http_response_code=$(curl \
--silent \
--write-out "%{http_code}" \
--output /dev/null \
--head \
--url "https://rpm.lair.cafe/fedora/43/x86_64/mistralrs-server-cuda13-${version}-1.fc43.x86_64.rpm")
if [ "${http_response_code}" = "200" ]; then
echo "already_built=true" >> "$GITHUB_OUTPUT"
elif [ "${http_response_code}" = "404" ]; then
echo "already_built=false" >> "$GITHUB_OUTPUT"
else
echo "Unexpected HTTP response code: ${http_response_code}"
exit 1
fi
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 }}\"}}"