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