feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
// Package release provides release automation with changelog generation and publishing.
|
|
|
|
|
// It orchestrates the build system, changelog generation, and publishing to targets
|
|
|
|
|
// like GitHub Releases.
|
|
|
|
|
package release
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
2026-04-01 15:53:44 +00:00
|
|
|
"sort"
|
|
|
|
|
"strings"
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
|
2026-03-26 17:41:53 +00:00
|
|
|
"dappco.re/go/core"
|
|
|
|
|
"dappco.re/go/core/build/internal/ax"
|
2026-04-01 09:46:42 +00:00
|
|
|
"dappco.re/go/core/build/internal/projectdetect"
|
2026-03-22 01:53:16 +00:00
|
|
|
"dappco.re/go/core/build/pkg/build"
|
|
|
|
|
"dappco.re/go/core/build/pkg/build/builders"
|
2026-04-01 13:30:33 +00:00
|
|
|
"dappco.re/go/core/build/pkg/build/signing"
|
2026-03-22 01:53:16 +00:00
|
|
|
"dappco.re/go/core/build/pkg/release/publishers"
|
|
|
|
|
"dappco.re/go/core/io"
|
|
|
|
|
coreerr "dappco.re/go/core/log"
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
)
|
|
|
|
|
|
2026-04-01 18:09:03 +00:00
|
|
|
// release signing hooks allow tests to observe the release pipeline without
|
|
|
|
|
// shelling out to platform-specific signing tools.
|
|
|
|
|
var (
|
|
|
|
|
signReleaseBinaries = signing.SignBinaries
|
|
|
|
|
notarizeReleaseBinaries = signing.NotarizeBinaries
|
|
|
|
|
signReleaseChecksums = signing.SignChecksums
|
|
|
|
|
)
|
|
|
|
|
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
// Release represents a release with its version, artifacts, and changelog.
|
2026-03-31 18:33:36 +01:00
|
|
|
//
|
|
|
|
|
// rel, err := release.Publish(ctx, cfg, false)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
type Release struct {
|
|
|
|
|
// Version is the semantic version string (e.g., "v1.2.3").
|
|
|
|
|
Version string
|
|
|
|
|
// Artifacts are the built release artifacts (archives with checksums).
|
|
|
|
|
Artifacts []build.Artifact
|
|
|
|
|
// Changelog is the generated markdown changelog.
|
|
|
|
|
Changelog string
|
|
|
|
|
// ProjectDir is the root directory of the project.
|
|
|
|
|
ProjectDir string
|
|
|
|
|
// FS is the medium for file operations.
|
|
|
|
|
FS io.Medium
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Publish publishes pre-built artifacts from dist/ to configured targets.
|
|
|
|
|
// Use this after `core build` to separate build and publish concerns.
|
2026-03-31 18:33:36 +01:00
|
|
|
//
|
|
|
|
|
// rel, err := release.Publish(ctx, cfg, false) // dryRun=true to preview
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
func Publish(ctx context.Context, cfg *Config, dryRun bool) (*Release, error) {
|
|
|
|
|
if cfg == nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.Publish", "config is nil", nil)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-31 18:37:59 +00:00
|
|
|
filesystem := io.Local
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
|
|
|
|
|
projectDir := cfg.projectDir
|
|
|
|
|
if projectDir == "" {
|
|
|
|
|
projectDir = "."
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Resolve to absolute path
|
2026-03-26 17:41:53 +00:00
|
|
|
absProjectDir, err := ax.Abs(projectDir)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.Publish", "failed to resolve project directory", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Step 1: Determine version
|
|
|
|
|
version := cfg.version
|
|
|
|
|
if version == "" {
|
2026-03-30 05:46:27 +00:00
|
|
|
version, err = DetermineVersionWithContext(ctx, absProjectDir)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.Publish", "failed to determine version", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Step 2: Find pre-built artifacts in dist/
|
2026-03-26 17:41:53 +00:00
|
|
|
distDir := ax.Join(absProjectDir, "dist")
|
2026-03-31 18:37:59 +00:00
|
|
|
artifacts, err := findArtifacts(filesystem, distDir)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.Publish", "failed to find artifacts", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if len(artifacts) == 0 {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.Publish", "no artifacts found in dist/\nRun 'core build' first to create artifacts", nil)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Step 3: Generate changelog
|
2026-03-30 05:46:27 +00:00
|
|
|
changelog, err := GenerateWithContext(ctx, absProjectDir, "", version)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-30 05:46:27 +00:00
|
|
|
if ctx.Err() != nil {
|
|
|
|
|
return nil, coreerr.E("release.Publish", "changelog generation cancelled", ctx.Err())
|
|
|
|
|
}
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
// Non-fatal: continue with empty changelog
|
2026-03-26 17:41:53 +00:00
|
|
|
changelog = core.Sprintf("Release %s", version)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
release := &Release{
|
|
|
|
|
Version: version,
|
|
|
|
|
Artifacts: artifacts,
|
|
|
|
|
Changelog: changelog,
|
|
|
|
|
ProjectDir: absProjectDir,
|
2026-03-31 18:37:59 +00:00
|
|
|
FS: filesystem,
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Step 4: Publish to configured targets
|
|
|
|
|
if len(cfg.Publishers) > 0 {
|
|
|
|
|
pubRelease := publishers.NewRelease(release.Version, release.Artifacts, release.Changelog, release.ProjectDir, release.FS)
|
|
|
|
|
|
2026-03-31 18:37:59 +00:00
|
|
|
for _, publisherConfig := range cfg.Publishers {
|
|
|
|
|
publisher, err := getPublisher(publisherConfig.Type)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return release, coreerr.E("release.Publish", "unsupported publisher", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-31 18:37:59 +00:00
|
|
|
extendedConfig := buildExtendedConfig(publisherConfig)
|
|
|
|
|
publisherRuntimeConfig := publishers.NewPublisherConfig(publisherConfig.Type, publisherConfig.Prerelease, publisherConfig.Draft, extendedConfig)
|
|
|
|
|
if err := publisher.Publish(ctx, pubRelease, publisherRuntimeConfig, cfg, dryRun); err != nil {
|
|
|
|
|
return release, coreerr.E("release.Publish", "publish to "+publisherConfig.Type+" failed", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return release, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// findArtifacts discovers pre-built artifacts in the dist directory.
|
2026-03-31 18:37:59 +00:00
|
|
|
func findArtifacts(filesystem io.Medium, distDir string) ([]build.Artifact, error) {
|
|
|
|
|
if !filesystem.IsDir(distDir) {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.findArtifacts", "dist/ directory not found", nil)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-01 15:53:44 +00:00
|
|
|
entries, err := filesystem.List(distDir)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, coreerr.E("release.findArtifacts", "failed to read dist/", err)
|
|
|
|
|
}
|
|
|
|
|
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
var artifacts []build.Artifact
|
2026-04-01 15:53:44 +00:00
|
|
|
for _, entry := range entries {
|
|
|
|
|
if entry.IsDir() {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if artifact, ok := releaseArtifactFromName(ax.Join(distDir, entry.Name()), entry.Name()); ok {
|
|
|
|
|
artifacts = append(artifacts, artifact)
|
|
|
|
|
}
|
|
|
|
|
}
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
|
2026-04-01 15:53:44 +00:00
|
|
|
if len(artifacts) > 0 {
|
|
|
|
|
return artifacts, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
platformArtifacts, err := findPlatformArtifacts(filesystem, distDir)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return platformArtifacts, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func findPlatformArtifacts(filesystem io.Medium, distDir string) ([]build.Artifact, error) {
|
2026-03-31 18:37:59 +00:00
|
|
|
entries, err := filesystem.List(distDir)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.findArtifacts", "failed to read dist/", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-01 15:53:44 +00:00
|
|
|
var artifacts []build.Artifact
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
for _, entry := range entries {
|
2026-04-01 15:53:44 +00:00
|
|
|
if !entry.IsDir() {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
osValue, archValue, ok := parsePlatformDir(entry.Name())
|
|
|
|
|
if !ok {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
platformDir := ax.Join(distDir, entry.Name())
|
|
|
|
|
files, err := filesystem.List(platformDir)
|
|
|
|
|
if err != nil {
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-01 15:53:44 +00:00
|
|
|
for _, file := range files {
|
|
|
|
|
if file.IsDir() {
|
2026-04-01 19:27:23 +00:00
|
|
|
if shouldPublishAppBundle(file.Name()) {
|
|
|
|
|
artifacts = append(artifacts, build.Artifact{
|
|
|
|
|
Path: ax.Join(platformDir, file.Name()),
|
|
|
|
|
OS: osValue,
|
|
|
|
|
Arch: archValue,
|
|
|
|
|
})
|
|
|
|
|
}
|
2026-04-01 15:53:44 +00:00
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
name := file.Name()
|
|
|
|
|
if !shouldPublishRawArtifact(name) {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
artifacts = append(artifacts, build.Artifact{
|
|
|
|
|
Path: ax.Join(platformDir, name),
|
|
|
|
|
OS: osValue,
|
|
|
|
|
Arch: archValue,
|
|
|
|
|
})
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-01 15:53:44 +00:00
|
|
|
sort.Slice(artifacts, func(i, j int) bool {
|
|
|
|
|
return artifacts[i].Path < artifacts[j].Path
|
|
|
|
|
})
|
|
|
|
|
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
return artifacts, nil
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-01 15:53:44 +00:00
|
|
|
func releaseArtifactFromName(path, name string) (build.Artifact, bool) {
|
|
|
|
|
if shouldPublishArchive(name) || shouldPublishChecksum(name) || shouldPublishSignature(name) {
|
|
|
|
|
return build.Artifact{Path: path}, true
|
|
|
|
|
}
|
|
|
|
|
return build.Artifact{}, false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func shouldPublishArchive(name string) bool {
|
|
|
|
|
return core.HasSuffix(name, ".tar.gz") ||
|
|
|
|
|
core.HasSuffix(name, ".tar.xz") ||
|
|
|
|
|
core.HasSuffix(name, ".zip")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func shouldPublishChecksum(name string) bool {
|
2026-04-01 16:36:40 +00:00
|
|
|
return name == "CHECKSUMS.txt"
|
2026-04-01 15:53:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func shouldPublishSignature(name string) bool {
|
|
|
|
|
return core.HasSuffix(name, ".asc") ||
|
|
|
|
|
core.HasSuffix(name, ".sig")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func shouldPublishRawArtifact(name string) bool {
|
|
|
|
|
if name == "" || strings.HasPrefix(name, ".") {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
if name == "artifact_meta.json" || name == "CHECKSUMS.txt" || name == "CHECKSUMS.txt.asc" {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-01 19:27:23 +00:00
|
|
|
func shouldPublishAppBundle(name string) bool {
|
|
|
|
|
return strings.HasSuffix(name, ".app")
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-01 15:53:44 +00:00
|
|
|
func parsePlatformDir(name string) (string, string, bool) {
|
|
|
|
|
osValue, archValue, ok := strings.Cut(name, "_")
|
|
|
|
|
if !ok || osValue == "" || archValue == "" {
|
|
|
|
|
return "", "", false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return osValue, archValue, true
|
|
|
|
|
}
|
|
|
|
|
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
// Run executes the full release process: determine version, build artifacts,
|
|
|
|
|
// generate changelog, and publish to configured targets.
|
2026-03-31 18:33:36 +01:00
|
|
|
// For separated concerns, prefer `core build` then `core ci` (Publish).
|
|
|
|
|
//
|
|
|
|
|
// rel, err := release.Run(ctx, cfg, false) // dryRun=true to preview
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
func Run(ctx context.Context, cfg *Config, dryRun bool) (*Release, error) {
|
|
|
|
|
if cfg == nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.Run", "config is nil", nil)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-31 18:37:59 +00:00
|
|
|
filesystem := io.Local
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
|
|
|
|
|
projectDir := cfg.projectDir
|
|
|
|
|
if projectDir == "" {
|
|
|
|
|
projectDir = "."
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Resolve to absolute path
|
2026-03-26 17:41:53 +00:00
|
|
|
absProjectDir, err := ax.Abs(projectDir)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.Run", "failed to resolve project directory", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Step 1: Determine version
|
|
|
|
|
version := cfg.version
|
|
|
|
|
if version == "" {
|
2026-03-30 05:46:27 +00:00
|
|
|
version, err = DetermineVersionWithContext(ctx, absProjectDir)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.Run", "failed to determine version", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Step 2: Generate changelog
|
2026-03-30 05:46:27 +00:00
|
|
|
changelog, err := GenerateWithContext(ctx, absProjectDir, "", version)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-30 05:46:27 +00:00
|
|
|
if ctx.Err() != nil {
|
|
|
|
|
return nil, coreerr.E("release.Run", "changelog generation cancelled", ctx.Err())
|
|
|
|
|
}
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
// Non-fatal: continue with empty changelog
|
2026-03-26 17:41:53 +00:00
|
|
|
changelog = core.Sprintf("Release %s", version)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Step 3: Build artifacts
|
2026-03-31 18:37:59 +00:00
|
|
|
artifacts, err := buildArtifacts(ctx, filesystem, cfg, absProjectDir, version)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.Run", "build failed", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
release := &Release{
|
|
|
|
|
Version: version,
|
|
|
|
|
Artifacts: artifacts,
|
|
|
|
|
Changelog: changelog,
|
|
|
|
|
ProjectDir: absProjectDir,
|
2026-03-31 18:37:59 +00:00
|
|
|
FS: filesystem,
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Step 4: Publish to configured targets
|
|
|
|
|
if len(cfg.Publishers) > 0 {
|
|
|
|
|
// Convert to publisher types
|
|
|
|
|
pubRelease := publishers.NewRelease(release.Version, release.Artifacts, release.Changelog, release.ProjectDir, release.FS)
|
|
|
|
|
|
2026-03-31 18:37:59 +00:00
|
|
|
for _, publisherConfig := range cfg.Publishers {
|
|
|
|
|
publisher, err := getPublisher(publisherConfig.Type)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return release, coreerr.E("release.Run", "unsupported publisher", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Build extended config for publisher-specific settings
|
2026-03-31 18:37:59 +00:00
|
|
|
extendedConfig := buildExtendedConfig(publisherConfig)
|
|
|
|
|
publisherRuntimeConfig := publishers.NewPublisherConfig(publisherConfig.Type, publisherConfig.Prerelease, publisherConfig.Draft, extendedConfig)
|
|
|
|
|
if err := publisher.Publish(ctx, pubRelease, publisherRuntimeConfig, cfg, dryRun); err != nil {
|
|
|
|
|
return release, coreerr.E("release.Run", "publish to "+publisherConfig.Type+" failed", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return release, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// buildArtifacts builds all artifacts for the release.
|
2026-03-31 18:37:59 +00:00
|
|
|
func buildArtifacts(ctx context.Context, filesystem io.Medium, cfg *Config, projectDir, version string) ([]build.Artifact, error) {
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
// Load build configuration
|
2026-03-31 18:37:59 +00:00
|
|
|
buildConfig, err := build.LoadConfig(filesystem, projectDir)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.buildArtifacts", "failed to load build config", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-01 12:24:03 +00:00
|
|
|
if err := build.SetupBuildCache(filesystem, projectDir, buildConfig); err != nil {
|
|
|
|
|
return nil, coreerr.E("release.buildArtifacts", "failed to set up build cache", err)
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-01 11:38:35 +00:00
|
|
|
discovery, err := build.DiscoverFull(filesystem, projectDir)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, coreerr.E("release.buildArtifacts", "failed to inspect project for build options", err)
|
|
|
|
|
}
|
|
|
|
|
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
// Determine targets
|
|
|
|
|
var targets []build.Target
|
|
|
|
|
if len(cfg.Build.Targets) > 0 {
|
2026-03-31 18:37:59 +00:00
|
|
|
for _, targetConfig := range cfg.Build.Targets {
|
|
|
|
|
targets = append(targets, build.Target{OS: targetConfig.OS, Arch: targetConfig.Arch})
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
2026-03-31 18:37:59 +00:00
|
|
|
} else if len(buildConfig.Targets) > 0 {
|
|
|
|
|
targets = buildConfig.ToTargets()
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
} else {
|
|
|
|
|
// Default targets
|
|
|
|
|
targets = []build.Target{
|
|
|
|
|
{OS: "linux", Arch: "amd64"},
|
|
|
|
|
{OS: "linux", Arch: "arm64"},
|
|
|
|
|
{OS: "darwin", Arch: "arm64"},
|
|
|
|
|
{OS: "windows", Arch: "amd64"},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Determine binary name
|
|
|
|
|
binaryName := cfg.Project.Name
|
|
|
|
|
if binaryName == "" {
|
2026-03-31 18:37:59 +00:00
|
|
|
binaryName = buildConfig.Project.Binary
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
if binaryName == "" {
|
2026-03-31 18:37:59 +00:00
|
|
|
binaryName = buildConfig.Project.Name
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
if binaryName == "" {
|
2026-03-26 17:41:53 +00:00
|
|
|
binaryName = ax.Base(projectDir)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Determine output directory
|
2026-03-26 17:41:53 +00:00
|
|
|
outputDir := ax.Join(projectDir, "dist")
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
|
2026-04-01 12:19:53 +00:00
|
|
|
// Get builder, respecting an explicit build type override when configured.
|
|
|
|
|
projectType, err := resolveProjectType(filesystem, projectDir, buildConfig.Build.Type)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.buildArtifacts", "failed to detect project type", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
builder, err := getBuilder(projectType)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Build configuration
|
2026-03-31 18:37:59 +00:00
|
|
|
builderConfig := &build.Config{
|
2026-04-01 18:04:26 +00:00
|
|
|
FS: filesystem,
|
|
|
|
|
Project: buildConfig.Project,
|
|
|
|
|
ProjectDir: projectDir,
|
|
|
|
|
OutputDir: outputDir,
|
|
|
|
|
Name: binaryName,
|
|
|
|
|
Version: version,
|
|
|
|
|
LDFlags: append([]string{}, buildConfig.Build.LDFlags...),
|
|
|
|
|
Flags: append([]string{}, buildConfig.Build.Flags...),
|
|
|
|
|
BuildTags: append([]string{}, buildConfig.Build.BuildTags...),
|
|
|
|
|
Env: append([]string{}, buildConfig.Build.Env...),
|
|
|
|
|
Cache: buildConfig.Build.Cache,
|
|
|
|
|
CGO: buildConfig.Build.CGO,
|
|
|
|
|
Obfuscate: buildConfig.Build.Obfuscate,
|
|
|
|
|
NSIS: buildConfig.Build.NSIS,
|
|
|
|
|
WebView2: buildConfig.Build.WebView2,
|
|
|
|
|
Dockerfile: buildConfig.Build.Dockerfile,
|
|
|
|
|
Registry: buildConfig.Build.Registry,
|
|
|
|
|
Image: buildConfig.Build.Image,
|
|
|
|
|
Tags: append([]string{}, buildConfig.Build.Tags...),
|
2026-04-01 19:52:42 +00:00
|
|
|
BuildArgs: build.CloneStringMap(buildConfig.Build.BuildArgs),
|
2026-04-01 18:04:26 +00:00
|
|
|
Push: buildConfig.Build.Push,
|
|
|
|
|
Load: buildConfig.Build.Load,
|
|
|
|
|
LinuxKitConfig: buildConfig.Build.LinuxKitConfig,
|
|
|
|
|
Formats: append([]string{}, buildConfig.Build.Formats...),
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
2026-04-01 11:38:35 +00:00
|
|
|
build.ApplyOptions(builderConfig, build.ComputeOptions(buildConfig, discovery))
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
|
|
|
|
|
// Build
|
2026-03-31 18:37:59 +00:00
|
|
|
artifacts, err := builder.Build(ctx, builderConfig, targets)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.buildArtifacts", "build failed", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-01 21:28:47 +00:00
|
|
|
if err := writeArtifactMetadata(filesystem, binaryName, artifacts); err != nil {
|
|
|
|
|
return nil, coreerr.E("release.buildArtifacts", "failed to write artifact metadata", err)
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-01 18:09:03 +00:00
|
|
|
signingArtifacts := make([]signing.Artifact, len(artifacts))
|
|
|
|
|
for i, artifact := range artifacts {
|
|
|
|
|
signingArtifacts[i] = signing.Artifact{
|
|
|
|
|
Path: artifact.Path,
|
|
|
|
|
OS: artifact.OS,
|
|
|
|
|
Arch: artifact.Arch,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if buildConfig.Sign.Enabled {
|
|
|
|
|
if err := signReleaseBinaries(ctx, filesystem, buildConfig.Sign, signingArtifacts); err != nil {
|
|
|
|
|
return nil, coreerr.E("release.buildArtifacts", "failed to sign binaries", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := notarizeReleaseBinaries(ctx, filesystem, buildConfig.Sign, signingArtifacts); err != nil {
|
|
|
|
|
return nil, coreerr.E("release.buildArtifacts", "failed to notarise binaries", err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
// Archive artifacts
|
2026-04-01 13:58:56 +00:00
|
|
|
archiveFormatValue := cfg.Build.ArchiveFormat
|
|
|
|
|
if archiveFormatValue == "" {
|
|
|
|
|
archiveFormatValue = buildConfig.Build.ArchiveFormat
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
archiveFormat, err := build.ParseArchiveFormat(archiveFormatValue)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, coreerr.E("release.buildArtifacts", "invalid archive format", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
archivedArtifacts, err := build.ArchiveAllWithFormat(filesystem, artifacts, archiveFormat)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.buildArtifacts", "archive failed", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Compute checksums
|
2026-03-31 18:37:59 +00:00
|
|
|
checksummedArtifacts, err := build.ChecksumAll(filesystem, archivedArtifacts)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
if err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.buildArtifacts", "checksum failed", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Write CHECKSUMS.txt
|
2026-03-26 17:41:53 +00:00
|
|
|
checksumPath := ax.Join(outputDir, "CHECKSUMS.txt")
|
2026-03-31 18:37:59 +00:00
|
|
|
if err := build.WriteChecksumFile(filesystem, checksummedArtifacts, checksumPath); err != nil {
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.buildArtifacts", "failed to write checksums file", err)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-01 13:30:33 +00:00
|
|
|
// Sign CHECKSUMS.txt when signing is configured.
|
2026-04-01 18:09:03 +00:00
|
|
|
if err := signReleaseChecksums(ctx, filesystem, buildConfig.Sign, checksumPath); err != nil {
|
2026-04-01 13:30:33 +00:00
|
|
|
return nil, coreerr.E("release.buildArtifacts", "failed to sign checksums file", err)
|
|
|
|
|
}
|
|
|
|
|
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
// Add CHECKSUMS.txt as an artifact
|
|
|
|
|
checksumArtifact := build.Artifact{
|
|
|
|
|
Path: checksumPath,
|
|
|
|
|
}
|
|
|
|
|
checksummedArtifacts = append(checksummedArtifacts, checksumArtifact)
|
|
|
|
|
|
2026-04-01 13:30:33 +00:00
|
|
|
// Add the detached signature when one was created.
|
|
|
|
|
signaturePath := checksumPath + ".asc"
|
|
|
|
|
if filesystem.Exists(signaturePath) {
|
|
|
|
|
checksummedArtifacts = append(checksummedArtifacts, build.Artifact{
|
|
|
|
|
Path: signaturePath,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
return checksummedArtifacts, nil
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-01 21:28:47 +00:00
|
|
|
// writeArtifactMetadata writes artifact_meta.json files next to built artifacts
|
|
|
|
|
// when GitHub metadata is available.
|
|
|
|
|
func writeArtifactMetadata(filesystem io.Medium, buildName string, artifacts []build.Artifact) error {
|
|
|
|
|
ci := build.DetectCI()
|
|
|
|
|
if ci == nil {
|
|
|
|
|
ci = build.DetectGitHubMetadata()
|
|
|
|
|
}
|
|
|
|
|
if ci == nil {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, artifact := range artifacts {
|
|
|
|
|
metaPath := ax.Join(ax.Dir(artifact.Path), "artifact_meta.json")
|
|
|
|
|
if err := build.WriteArtifactMeta(filesystem, metaPath, buildName, build.Target{OS: artifact.OS, Arch: artifact.Arch}, ci); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
// getBuilder returns the appropriate builder for the project type.
|
|
|
|
|
func getBuilder(projectType build.ProjectType) (build.Builder, error) {
|
|
|
|
|
switch projectType {
|
|
|
|
|
case build.ProjectTypeWails:
|
|
|
|
|
return builders.NewWailsBuilder(), nil
|
|
|
|
|
case build.ProjectTypeGo:
|
|
|
|
|
return builders.NewGoBuilder(), nil
|
|
|
|
|
case build.ProjectTypeNode:
|
2026-04-01 10:41:59 +00:00
|
|
|
return builders.NewNodeBuilder(), nil
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
case build.ProjectTypePHP:
|
2026-04-01 10:41:59 +00:00
|
|
|
return builders.NewPHPBuilder(), nil
|
2026-04-01 11:31:10 +00:00
|
|
|
case build.ProjectTypePython:
|
|
|
|
|
return builders.NewPythonBuilder(), nil
|
2026-04-01 11:14:23 +00:00
|
|
|
case build.ProjectTypeRust:
|
|
|
|
|
return builders.NewRustBuilder(), nil
|
2026-04-01 11:10:27 +00:00
|
|
|
case build.ProjectTypeDocs:
|
|
|
|
|
return builders.NewDocsBuilder(), nil
|
2026-04-01 11:47:12 +00:00
|
|
|
case build.ProjectTypeCPP:
|
|
|
|
|
return builders.NewCPPBuilder(), nil
|
2026-04-01 12:19:53 +00:00
|
|
|
case build.ProjectTypeDocker:
|
|
|
|
|
return builders.NewDockerBuilder(), nil
|
|
|
|
|
case build.ProjectTypeLinuxKit:
|
|
|
|
|
return builders.NewLinuxKitBuilder(), nil
|
|
|
|
|
case build.ProjectTypeTaskfile:
|
|
|
|
|
return builders.NewTaskfileBuilder(), nil
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
default:
|
2026-03-16 21:03:21 +00:00
|
|
|
return nil, coreerr.E("release.getBuilder", "unsupported project type: "+string(projectType), nil)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-01 12:19:53 +00:00
|
|
|
// resolveProjectType determines which builder type to use for release builds.
|
|
|
|
|
// An explicit build type in .core/build.yaml takes precedence over marker-based detection.
|
|
|
|
|
func resolveProjectType(filesystem io.Medium, projectDir, buildType string) (build.ProjectType, error) {
|
|
|
|
|
if buildType != "" {
|
|
|
|
|
return build.ProjectType(buildType), nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return projectdetect.DetectProjectType(filesystem, projectDir)
|
|
|
|
|
}
|
|
|
|
|
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
// getPublisher returns the publisher for the given type.
|
2026-03-31 18:37:59 +00:00
|
|
|
func getPublisher(publisherType string) (publishers.Publisher, error) {
|
|
|
|
|
switch publisherType {
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
case "github":
|
|
|
|
|
return publishers.NewGitHubPublisher(), nil
|
|
|
|
|
case "linuxkit":
|
|
|
|
|
return publishers.NewLinuxKitPublisher(), nil
|
|
|
|
|
case "docker":
|
|
|
|
|
return publishers.NewDockerPublisher(), nil
|
|
|
|
|
case "npm":
|
|
|
|
|
return publishers.NewNpmPublisher(), nil
|
|
|
|
|
case "homebrew":
|
|
|
|
|
return publishers.NewHomebrewPublisher(), nil
|
|
|
|
|
case "scoop":
|
|
|
|
|
return publishers.NewScoopPublisher(), nil
|
|
|
|
|
case "aur":
|
|
|
|
|
return publishers.NewAURPublisher(), nil
|
|
|
|
|
case "chocolatey":
|
|
|
|
|
return publishers.NewChocolateyPublisher(), nil
|
|
|
|
|
default:
|
2026-03-31 18:37:59 +00:00
|
|
|
return nil, coreerr.E("release.getPublisher", "unsupported publisher type: "+publisherType, nil)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// buildExtendedConfig builds a map of extended configuration for a publisher.
|
2026-03-31 18:37:59 +00:00
|
|
|
func buildExtendedConfig(publisherConfig PublisherConfig) map[string]any {
|
|
|
|
|
extendedConfig := make(map[string]any)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
|
|
|
|
|
// LinuxKit-specific config
|
2026-03-31 18:37:59 +00:00
|
|
|
if publisherConfig.Config != "" {
|
|
|
|
|
extendedConfig["config"] = publisherConfig.Config
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
2026-03-31 18:37:59 +00:00
|
|
|
if len(publisherConfig.Formats) > 0 {
|
|
|
|
|
extendedConfig["formats"] = toAnySlice(publisherConfig.Formats)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
2026-03-31 18:37:59 +00:00
|
|
|
if len(publisherConfig.Platforms) > 0 {
|
|
|
|
|
extendedConfig["platforms"] = toAnySlice(publisherConfig.Platforms)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Docker-specific config
|
2026-03-31 18:37:59 +00:00
|
|
|
if publisherConfig.Registry != "" {
|
|
|
|
|
extendedConfig["registry"] = publisherConfig.Registry
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
2026-03-31 18:37:59 +00:00
|
|
|
if publisherConfig.Image != "" {
|
|
|
|
|
extendedConfig["image"] = publisherConfig.Image
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
2026-03-31 18:37:59 +00:00
|
|
|
if publisherConfig.Dockerfile != "" {
|
|
|
|
|
extendedConfig["dockerfile"] = publisherConfig.Dockerfile
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
2026-03-31 18:37:59 +00:00
|
|
|
if len(publisherConfig.Tags) > 0 {
|
|
|
|
|
extendedConfig["tags"] = toAnySlice(publisherConfig.Tags)
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
2026-03-31 18:37:59 +00:00
|
|
|
if len(publisherConfig.BuildArgs) > 0 {
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
args := make(map[string]any)
|
2026-03-31 18:37:59 +00:00
|
|
|
for k, v := range publisherConfig.BuildArgs {
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
args[k] = v
|
|
|
|
|
}
|
2026-03-31 18:37:59 +00:00
|
|
|
extendedConfig["build_args"] = args
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// npm-specific config
|
2026-03-31 18:37:59 +00:00
|
|
|
if publisherConfig.Package != "" {
|
|
|
|
|
extendedConfig["package"] = publisherConfig.Package
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
2026-03-31 18:37:59 +00:00
|
|
|
if publisherConfig.Access != "" {
|
|
|
|
|
extendedConfig["access"] = publisherConfig.Access
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Homebrew-specific config
|
2026-03-31 18:37:59 +00:00
|
|
|
if publisherConfig.Tap != "" {
|
|
|
|
|
extendedConfig["tap"] = publisherConfig.Tap
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
2026-03-31 18:37:59 +00:00
|
|
|
if publisherConfig.Formula != "" {
|
|
|
|
|
extendedConfig["formula"] = publisherConfig.Formula
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Scoop-specific config
|
2026-03-31 18:37:59 +00:00
|
|
|
if publisherConfig.Bucket != "" {
|
|
|
|
|
extendedConfig["bucket"] = publisherConfig.Bucket
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// AUR-specific config
|
2026-03-31 18:37:59 +00:00
|
|
|
if publisherConfig.Maintainer != "" {
|
|
|
|
|
extendedConfig["maintainer"] = publisherConfig.Maintainer
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-16 21:03:21 +00:00
|
|
|
// Chocolatey-specific configuration
|
2026-03-31 18:37:59 +00:00
|
|
|
if publisherConfig.Push {
|
|
|
|
|
extendedConfig["push"] = publisherConfig.Push
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Official repo config (shared by multiple publishers)
|
2026-03-31 18:37:59 +00:00
|
|
|
if publisherConfig.Official != nil {
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
official := make(map[string]any)
|
2026-03-31 18:37:59 +00:00
|
|
|
official["enabled"] = publisherConfig.Official.Enabled
|
|
|
|
|
if publisherConfig.Official.Output != "" {
|
|
|
|
|
official["output"] = publisherConfig.Official.Output
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
2026-03-31 18:37:59 +00:00
|
|
|
extendedConfig["official"] = official
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-31 18:37:59 +00:00
|
|
|
return extendedConfig
|
feat: extract build/, release/, sdk/ from go-devops
Build system (8 builders, signing, archiving), release pipeline
(7 publishers, versioning, changelog), and SDK generation
(OpenAPI diff, code gen). 18K LOC, all tests pass except Go
builder workspace isolation (pre-existing).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:37:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// toAnySlice converts a string slice to an any slice.
|
|
|
|
|
func toAnySlice(s []string) []any {
|
|
|
|
|
result := make([]any, len(s))
|
|
|
|
|
for i, v := range s {
|
|
|
|
|
result[i] = v
|
|
|
|
|
}
|
|
|
|
|
return result
|
|
|
|
|
}
|