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:
@@ -1,23 +1,47 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import type { PackagesManifest } from "../types/packages.ts";
|
||||
import type { Channel, PackagesManifest, PackageVersion } from "../types/packages.ts";
|
||||
|
||||
const MANIFEST_URL = "/fedora/43/x86_64/packages.json";
|
||||
const STABLE_URL = "/fedora/43/x86_64/packages.json";
|
||||
const UNSTABLE_URL = "/fedora/43/x86_64/unstable/packages.json";
|
||||
|
||||
function tagPackages(
|
||||
manifest: PackagesManifest,
|
||||
channel: Channel,
|
||||
): PackageVersion[] {
|
||||
return manifest.packages.map((p) => ({
|
||||
...p,
|
||||
channel,
|
||||
baseUrl: manifest.baseUrl,
|
||||
}));
|
||||
}
|
||||
|
||||
export function usePackages() {
|
||||
const [manifest, setManifest] = useState<PackagesManifest | null>(null);
|
||||
const [packages, setPackages] = useState<PackageVersion[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
|
||||
fetch(MANIFEST_URL)
|
||||
.then((res) => {
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
return res.json() as Promise<PackagesManifest>;
|
||||
})
|
||||
.then((data) => {
|
||||
if (!cancelled) setManifest(data);
|
||||
const fetchManifest = async (
|
||||
url: string,
|
||||
channel: Channel,
|
||||
): Promise<PackageVersion[]> => {
|
||||
const res = await fetch(url);
|
||||
if (!res.ok) {
|
||||
if (res.status === 404) return [];
|
||||
throw new Error(`HTTP ${res.status} fetching ${channel} manifest`);
|
||||
}
|
||||
const data = (await res.json()) as PackagesManifest;
|
||||
return tagPackages(data, channel);
|
||||
};
|
||||
|
||||
Promise.all([
|
||||
fetchManifest(STABLE_URL, "stable"),
|
||||
fetchManifest(UNSTABLE_URL, "unstable"),
|
||||
])
|
||||
.then(([stable, unstable]) => {
|
||||
if (!cancelled) setPackages([...stable, ...unstable]);
|
||||
})
|
||||
.catch((err: unknown) => {
|
||||
if (!cancelled)
|
||||
@@ -32,5 +56,5 @@ export function usePackages() {
|
||||
};
|
||||
}, []);
|
||||
|
||||
return { manifest, loading, error };
|
||||
return { packages, loading, error };
|
||||
}
|
||||
|
||||
@@ -10,6 +10,13 @@ enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=${GPG_KEY_URL}`;
|
||||
|
||||
const UNSTABLE_REPO_FILE = `[lair-cafe-unstable]
|
||||
name=lair.cafe RPM Repository (unstable)
|
||||
baseurl=https://rpm.lair.cafe/fedora/$releasever/$basearch/unstable/
|
||||
enabled=0
|
||||
gpgcheck=1
|
||||
gpgkey=${GPG_KEY_URL}`;
|
||||
|
||||
export function Home() {
|
||||
return (
|
||||
<>
|
||||
@@ -43,6 +50,50 @@ export function Home() {
|
||||
</Card.Body>
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
<Col lg={12}>
|
||||
<Card>
|
||||
<Card.Body>
|
||||
<Card.Title>Unstable (prerelease) packages</Card.Title>
|
||||
<p>
|
||||
Unstable packages are built automatically from the latest
|
||||
upstream <code>main</code> branch commit. They use the
|
||||
next release version from <code>Cargo.toml</code> with a
|
||||
prerelease suffix (e.g.{" "}
|
||||
<code>0.8.1-0.1.20260511git1a2b3c4</code>). When the
|
||||
upstream version is officially released, the stable package
|
||||
will automatically supersede any installed prerelease.
|
||||
</p>
|
||||
|
||||
<h6 className="mt-4">Add the unstable repository</h6>
|
||||
<p className="text-body-secondary">
|
||||
The unstable repo is disabled by default. Add it alongside the
|
||||
stable repo:
|
||||
</p>
|
||||
<CodeBlock language="bash">
|
||||
{`sudo dnf config-manager addrepo --from-repofile=/dev/stdin <<'EOF'\n${UNSTABLE_REPO_FILE}\nEOF`}
|
||||
</CodeBlock>
|
||||
|
||||
<h6 className="mt-4">
|
||||
Install or update from unstable
|
||||
</h6>
|
||||
<CodeBlock language="bash">
|
||||
{`sudo dnf --enablerepo=lair-cafe-unstable install mistralrs-cuda13`}
|
||||
</CodeBlock>
|
||||
|
||||
<h6 className="mt-4">
|
||||
Pin to stable
|
||||
</h6>
|
||||
<p className="text-body-secondary">
|
||||
If you have the unstable repo enabled and want to stay on
|
||||
stable releases, exclude prerelease versions:
|
||||
</p>
|
||||
<CodeBlock language="bash">
|
||||
{`sudo dnf --disablerepo=lair-cafe-unstable update mistralrs-cuda13`}
|
||||
</CodeBlock>
|
||||
</Card.Body>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -11,13 +11,13 @@ function formatBytes(bytes: number): string {
|
||||
|
||||
export function PackageDetail() {
|
||||
const { name } = useParams<{ name: string }>();
|
||||
const { manifest, loading, error } = usePackages();
|
||||
const { packages, loading, error } = usePackages();
|
||||
|
||||
if (loading) return <Spinner animation="border" />;
|
||||
if (error) return <Alert variant="danger">Failed to load packages: {error}</Alert>;
|
||||
if (!manifest) return <Alert variant="info">No package data available.</Alert>;
|
||||
if (packages.length === 0) return <Alert variant="info">No package data available.</Alert>;
|
||||
|
||||
const versions = manifest.packages
|
||||
const versions = packages
|
||||
.filter((p) => p.name === name)
|
||||
.sort((a, b) => b.buildTime - a.buildTime);
|
||||
|
||||
@@ -25,6 +25,7 @@ export function PackageDetail() {
|
||||
return <Alert variant="warning">Package not found: {name}</Alert>;
|
||||
|
||||
const latest = versions[0];
|
||||
const hasUnstable = versions.some((v) => v.channel === "unstable");
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -33,6 +34,14 @@ export function PackageDetail() {
|
||||
|
||||
<CodeBlock language="bash">{`sudo dnf install ${name}`}</CodeBlock>
|
||||
|
||||
{hasUnstable && (
|
||||
<div className="mt-3">
|
||||
<CodeBlock language="bash">
|
||||
{`# install latest unstable version\nsudo dnf --enablerepo=lair-cafe-unstable install ${name}`}
|
||||
</CodeBlock>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<h2 className="mt-4 mb-3">
|
||||
Versions <Badge bg="secondary">{versions.length}</Badge>
|
||||
</h2>
|
||||
@@ -41,6 +50,7 @@ export function PackageDetail() {
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Version</th>
|
||||
<th>Channel</th>
|
||||
<th>Size</th>
|
||||
<th>Built</th>
|
||||
<th>Download</th>
|
||||
@@ -48,14 +58,19 @@ export function PackageDetail() {
|
||||
</thead>
|
||||
<tbody>
|
||||
{versions.map((pkg) => (
|
||||
<tr key={`${pkg.version}-${pkg.release}`}>
|
||||
<tr key={`${pkg.version}-${pkg.release}-${pkg.channel}`}>
|
||||
<td>
|
||||
{pkg.version}-{pkg.release}
|
||||
</td>
|
||||
<td>
|
||||
<Badge bg={pkg.channel === "stable" ? "success" : "warning"}>
|
||||
{pkg.channel}
|
||||
</Badge>
|
||||
</td>
|
||||
<td>{formatBytes(pkg.size)}</td>
|
||||
<td>{new Date(pkg.buildTime * 1000).toLocaleDateString()}</td>
|
||||
<td>
|
||||
<a href={`${manifest.baseUrl}/${pkg.rpmFilename}`}>
|
||||
<a href={`${pkg.baseUrl}/${pkg.rpmFilename}`}>
|
||||
{pkg.rpmFilename}
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
import { Alert, Spinner, Table } from "react-bootstrap";
|
||||
import { Alert, Badge, Spinner, Table } from "react-bootstrap";
|
||||
import { Link } from "react-router";
|
||||
import { usePackages } from "../hooks/usePackages.ts";
|
||||
|
||||
export function PackageList() {
|
||||
const { manifest, loading, error } = usePackages();
|
||||
const { packages, loading, error } = usePackages();
|
||||
|
||||
if (loading) return <Spinner animation="border" />;
|
||||
if (error) return <Alert variant="danger">Failed to load packages: {error}</Alert>;
|
||||
if (!manifest || manifest.packages.length === 0)
|
||||
if (packages.length === 0)
|
||||
return <Alert variant="info">No packages published yet.</Alert>;
|
||||
|
||||
const byName = Map.groupBy(manifest.packages, (p) => p.name);
|
||||
const byName = Map.groupBy(packages, (p) => p.name);
|
||||
const summaries = [...byName.entries()].map(([name, versions]) => {
|
||||
const stable = versions.filter((v) => v.channel === "stable");
|
||||
const unstable = versions.filter((v) => v.channel === "unstable");
|
||||
const latest = versions.reduce((a, b) =>
|
||||
a.buildTime >= b.buildTime ? a : b,
|
||||
);
|
||||
return { name, latest, versionCount: versions.length };
|
||||
return {
|
||||
name,
|
||||
latest,
|
||||
stableCount: stable.length,
|
||||
unstableCount: unstable.length,
|
||||
versionCount: versions.length,
|
||||
};
|
||||
});
|
||||
summaries.sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
@@ -33,15 +41,25 @@ export function PackageList() {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{summaries.map(({ name, latest, versionCount }) => (
|
||||
{summaries.map(({ name, latest, stableCount, unstableCount }) => (
|
||||
<tr key={name}>
|
||||
<td>
|
||||
<Link to={`/packages/${name}`}>{name}</Link>
|
||||
</td>
|
||||
<td>
|
||||
{latest.version}-{latest.release}
|
||||
{latest.version}-{latest.release}{" "}
|
||||
<Badge bg={latest.channel === "stable" ? "success" : "warning"} className="ms-1">
|
||||
{latest.channel}
|
||||
</Badge>
|
||||
</td>
|
||||
<td>
|
||||
{stableCount > 0 && (
|
||||
<Badge bg="success" className="me-1">{stableCount} stable</Badge>
|
||||
)}
|
||||
{unstableCount > 0 && (
|
||||
<Badge bg="warning">{unstableCount} unstable</Badge>
|
||||
)}
|
||||
</td>
|
||||
<td>{versionCount}</td>
|
||||
<td>{latest.summary}</td>
|
||||
<td>{new Date(latest.buildTime * 1000).toLocaleDateString()}</td>
|
||||
</tr>
|
||||
|
||||
@@ -4,6 +4,8 @@ export interface ChangelogEntry {
|
||||
text: string;
|
||||
}
|
||||
|
||||
export type Channel = "stable" | "unstable";
|
||||
|
||||
export interface PackageVersion {
|
||||
name: string;
|
||||
version: string;
|
||||
@@ -14,6 +16,8 @@ export interface PackageVersion {
|
||||
buildTime: number;
|
||||
rpmFilename: string;
|
||||
changelog: ChangelogEntry[];
|
||||
channel: Channel;
|
||||
baseUrl: string;
|
||||
}
|
||||
|
||||
export interface PackagesManifest {
|
||||
|
||||
Reference in New Issue
Block a user