From bd3bd85e438ab96c3dc94c306d1c40929e855241 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 11 Mar 2026 11:46:59 -0600 Subject: [PATCH] feat(installerconf): github_source packages include git_url for clone fallback git_url is now a standalone field that can appear alongside any source type. For githubsource packages, it adds a git clone entry per release in addition to the tarball and zipball. Updated aliasman, duckdns.sh, and serviceman configs. --- aliasman/releases.conf | 1 + duckdns.sh/releases.conf | 1 + internal/classifypkg/classifypkg.go | 10 ++++++++++ internal/installerconf/installerconf.go | 10 ++++++++++ serviceman/releases.conf | 1 + 5 files changed, 23 insertions(+) diff --git a/aliasman/releases.conf b/aliasman/releases.conf index 1cc8f96..7b87dc9 100644 --- a/aliasman/releases.conf +++ b/aliasman/releases.conf @@ -1 +1,2 @@ github_source = BeyondCodeBootcamp/aliasman +git_url = https://github.com/BeyondCodeBootcamp/aliasman.git diff --git a/duckdns.sh/releases.conf b/duckdns.sh/releases.conf index a0ed3d4..a08e849 100644 --- a/duckdns.sh/releases.conf +++ b/duckdns.sh/releases.conf @@ -1 +1,2 @@ github_source = BeyondCodeBootcamp/DuckDNS.sh +git_url = https://github.com/BeyondCodeBootcamp/DuckDNS.sh.git diff --git a/internal/classifypkg/classifypkg.go b/internal/classifypkg/classifypkg.go index 691572d..63db759 100644 --- a/internal/classifypkg/classifypkg.go +++ b/internal/classifypkg/classifypkg.go @@ -445,6 +445,16 @@ func classifyGitHubSource(pkg string, conf *installerconf.Conf, d *rawcache.Dir) Date: date, }) } + if conf.GitURL != "" { + assets = append(assets, storage.Asset{ + Filename: repo + "-" + tag, + Version: version, + Channel: channel, + Format: "git", + Download: conf.GitURL, + Date: date, + }) + } } return assets, nil } diff --git a/internal/installerconf/installerconf.go b/internal/installerconf/installerconf.go index 2167171..92e4b52 100644 --- a/internal/installerconf/installerconf.go +++ b/internal/installerconf/installerconf.go @@ -74,6 +74,11 @@ type Conf struct { // (e.g. a Gitea instance or nodedist index URL). BaseURL string + // GitURL is the git clone URL for source-installable packages. + // Present alongside github_source/gitea_source to provide a + // git clone fallback in addition to release tarballs. + GitURL string + // TagPrefix filters releases in monorepos. Only tags starting with // this prefix are included, and the prefix is stripped from the // version string. Example: "tools/monorel/" @@ -160,6 +165,11 @@ func Read(path string) (*Conf, error) { c.BaseURL = raw["url"] } + // git_url can appear alongside any source type (e.g. github_source) + // to provide a git clone fallback. When it's the only key, it's the + // primary source (gittag). + c.GitURL = raw["git_url"] + c.TagPrefix = raw["tag_prefix"] if v := raw["version_prefixes"]; v != "" { diff --git a/serviceman/releases.conf b/serviceman/releases.conf index 3f244c3..95c18f5 100644 --- a/serviceman/releases.conf +++ b/serviceman/releases.conf @@ -1 +1,2 @@ github_source = bnnanet/serviceman +git_url = https://github.com/bnnanet/serviceman.git