feat: add prerelease RPM builds from upstream main branch
Some checks failed
deploy-ui / build-and-deploy (push) Has been cancelled
Some checks failed
deploy-ui / build-and-deploy (push) Has been cancelled
Poll upstream main branch HEAD alongside release tags. When a new commit is detected, build and publish prerelease RPMs to a separate unstable repo at rpm.lair.cafe/fedora/$releasever/$basearch/unstable/. RPM versioning uses the Fedora snapshot convention (e.g. 0.8.1-0.1.20260511git1a2b3c4.fc43) so stable releases automatically supersede any installed prerelease. - RPM spec: conditional Release field via mistralrs_prerelease define - poll-upstream.yml: new check-prerelease job fetches main HEAD + Cargo.toml version - build-prerelease.yml: new workflow for commit-based builds without --locked - UI: fetch both stable/unstable manifests, show channel badges, add unstable repo setup instructions to home page Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -83,3 +83,73 @@ jobs:
|
||||
--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 }}\"}}"
|
||||
|
||||
check-prerelease:
|
||||
runs-on: fedora-43
|
||||
steps:
|
||||
- name: Get upstream main branch HEAD
|
||||
id: upstream
|
||||
run: |
|
||||
response=$(curl --silent --show-error --fail --location \
|
||||
--header 'Accept: application/vnd.github+json' \
|
||||
--url 'https://api.github.com/repos/EricLBuehler/mistral.rs/commits/main')
|
||||
sha=$(echo "${response}" | jq -r .sha)
|
||||
short_sha=$(echo "${sha}" | head --bytes=7)
|
||||
date=$(echo "${response}" | jq -r '.commit.committer.date[:10]' | tr -d '-')
|
||||
echo "sha=${sha}" >> "$GITHUB_OUTPUT"
|
||||
echo "short_sha=${short_sha}" >> "$GITHUB_OUTPUT"
|
||||
echo "date=${date}" >> "$GITHUB_OUTPUT"
|
||||
echo "Upstream main HEAD: ${sha} (${date})"
|
||||
|
||||
- name: Get version from upstream Cargo.toml
|
||||
id: version
|
||||
run: |
|
||||
version=$(curl --silent --show-error --fail --location \
|
||||
--header 'Accept: application/vnd.github.raw+json' \
|
||||
--url "https://api.github.com/repos/EricLBuehler/mistral.rs/contents/Cargo.toml?ref=${{ steps.upstream.outputs.sha }}" \
|
||||
| grep '^version' | head --lines=1 | sed 's/.*"\(.*\)".*/\1/')
|
||||
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
||||
echo "Upstream Cargo.toml version: ${version}"
|
||||
|
||||
- name: Check if prerelease is already published
|
||||
id: published
|
||||
run: |
|
||||
prerelease="0.1.${UPSTREAM_DATE}git${UPSTREAM_SHORT_SHA}"
|
||||
needs_build=false
|
||||
for target in "43:cuda13"; do
|
||||
fedora_version="${target%%:*}"
|
||||
flavour="${target##*:}"
|
||||
base_url="https://rpm.lair.cafe/fedora/${fedora_version}/x86_64/unstable"
|
||||
rpm_name="mistralrs-${flavour}-${UPSTREAM_VERSION}-${prerelease}.fc${fedora_version}.x86_64.rpm"
|
||||
|
||||
http_code=$(curl \
|
||||
--silent \
|
||||
--write-out "%{http_code}" \
|
||||
--output /dev/null \
|
||||
--head \
|
||||
--url "${base_url}/${rpm_name}")
|
||||
if [ "${http_code}" = "404" ]; then
|
||||
echo "missing: ${base_url}/${rpm_name}"
|
||||
needs_build=true
|
||||
continue
|
||||
elif [ "${http_code}" != "200" ]; then
|
||||
echo "unexpected HTTP ${http_code} for ${base_url}/${rpm_name}"
|
||||
exit 1
|
||||
fi
|
||||
echo "found: ${base_url}/${rpm_name}"
|
||||
done
|
||||
echo "already_built=$( [ "${needs_build}" = "true" ] && echo false || echo true )" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
UPSTREAM_VERSION: ${{ steps.version.outputs.version }}
|
||||
UPSTREAM_DATE: ${{ steps.upstream.outputs.date }}
|
||||
UPSTREAM_SHORT_SHA: ${{ steps.upstream.outputs.short_sha }}
|
||||
|
||||
- name: Trigger prerelease 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-prerelease.yml/dispatches" \
|
||||
--data "{\"ref\":\"refs/heads/main\",\"inputs\":{\"commit\":\"${{ steps.upstream.outputs.sha }}\",\"version\":\"${{ steps.version.outputs.version }}\",\"date\":\"${{ steps.upstream.outputs.date }}\",\"short_sha\":\"${{ steps.upstream.outputs.short_sha }}\"}}"
|
||||
|
||||
Reference in New Issue
Block a user