44 lines
1.6 KiB
YAML
44 lines
1.6 KiB
YAML
name: poll-upstream
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "*/15 * * * *"
|
|
workflow_dispatch: {}
|
|
|
|
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}"
|
|
if curl -sSfI "https://rpm.lair.cafe/mistralrs/fedora-43/x86_64/mistralrs-server-cuda13-fa-${version}-1.fc43.x86_64.rpm" | grep -q '^HTTP.*200'; then
|
|
echo "already_built=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "already_built=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
env:
|
|
UPSTREAM_TAG: ${{ steps.upstream.outputs.tag }}
|
|
|
|
- name: Trigger build workflow
|
|
if: steps.published.outputs.already_built == 'false'
|
|
run: |
|
|
curl -sSfL -X POST \
|
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
|
-H 'Accept: application/json' \
|
|
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/workflows/build-release.yml/dispatches" \
|
|
-d "{\"ref\":\"main\",\"inputs\":{\"tag\":\"${{ steps.upstream.outputs.tag }}\"}}"
|