mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-05-26 18:42:58 +00:00
- TagVariants now applies confVariants from releases.conf as case-folded substring matches before package-specific logic, removing the need to hardcode simple variant names in Go - gitea: variants = gogit (excludes Windows gogit builds) - lsd: variants = msvc (moved from Go to conf) - pwsh: variants = fxdependent fxdependentWinDesktop appimage - bun: variants = profile (moved from Go to conf) - sttr: darwin_all tagged as universal2 so arm64 and amd64 Mac users are served; pkg.tar.zst excluded (Arch Linux package format) - add .claude/ to .gitignore
37 lines
1.3 KiB
Go
37 lines
1.3 KiB
Go
// Package bun provides variant tagging for Bun releases.
|
|
//
|
|
// Bun publishes -profile (debug) builds and uses a non-standard arch
|
|
// convention: the default x86_64 build targets x86_64_v3 (AVX2+),
|
|
// while -baseline targets plain x86_64.
|
|
package bundist
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/webinstall/webi-installers/internal/storage"
|
|
)
|
|
|
|
// TagVariants tags bun-specific build variants and remaps arch fields.
|
|
//
|
|
// Bun's default x86_64 build requires AVX2 (x86_64_v3). The -baseline
|
|
// build targets plain x86_64. For legacy export, baseline is the one
|
|
// we serve (matching Node.js behavior), so non-baseline gets a variant
|
|
// tag. The -baseline suffix is stripped from Filename (but not Download)
|
|
// so the legacy server sees a clean name.
|
|
func TagVariants(assets []storage.Asset) {
|
|
for i := range assets {
|
|
lower := strings.ToLower(assets[i].Filename)
|
|
if assets[i].Arch == "x86_64" {
|
|
if strings.Contains(lower, "-baseline") {
|
|
// Baseline is plain x86_64 — strip the suffix from
|
|
// Filename so the legacy server sees a clean name.
|
|
assets[i].Filename = strings.Replace(assets[i].Filename, "-baseline", "", 1)
|
|
} else {
|
|
// Non-baseline is v3 — tag as variant (excluded from legacy).
|
|
assets[i].Arch = "x86_64_v3"
|
|
assets[i].Variants = append(assets[i].Variants, "v3")
|
|
}
|
|
}
|
|
}
|
|
}
|