mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-08-23 22:16:48 +00:00
feat: add Go release cache daemon (webicached)
Rewrites the Node.js release classification pipeline in Go. webicached fetches upstream releases (GitHub, Gitea, GitLab, HashiCorp, custom sources), classifies assets by OS/arch/variant, and writes legacy-format JSON caches compatible with the existing webinstall.dev API. Git-clone packages emit git_tag and git_commit_hash from real repo clones — no fabricated refs.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// Package github fetches releases from the GitHub API.
|
||||
//
|
||||
// This is a thin wrapper around [githubish] that sets the base URL to
|
||||
// https://api.github.com. Use [githubish] directly for Gitea, Forgejo,
|
||||
// or other GitHub-compatible forges.
|
||||
package github
|
||||
|
||||
import (
|
||||
"context"
|
||||
"iter"
|
||||
"net/http"
|
||||
|
||||
"github.com/webinstall/webi-installers/internal/releases/githubish"
|
||||
)
|
||||
|
||||
const baseURL = "https://api.github.com"
|
||||
|
||||
// Fetch retrieves releases from GitHub for the given owner/repo.
|
||||
// Paginates automatically, yielding one batch per API page.
|
||||
func Fetch(ctx context.Context, client *http.Client, owner, repo string, auth *githubish.Auth) iter.Seq2[[]githubish.Release, error] {
|
||||
return githubish.Fetch(ctx, client, baseURL, owner, repo, auth)
|
||||
}
|
||||
Reference in New Issue
Block a user