Documentation
¶
Overview ¶
Package publishers provides release publishing implementations.
Package publishers provides release publishing implementations.
Package publishers provides release publishing implementations.
Package publishers provides release publishing implementations.
Package publishers provides release publishing implementations.
Package publishers provides release publishing implementations.
Package publishers provides release publishing implementations.
Package publishers provides release publishing implementations.
Package publishers provides release publishing implementations.
Index ¶
- func DeleteRelease(ctx context.Context, repo, version string) core.Result
- func DetectGitHubRepository(ctx context.Context, dir string) core.Result
- func ReleaseExists(ctx context.Context, repo, version string) bool
- func UploadArtifact(ctx context.Context, repo, version, artifactPath string) core.Result
- type AURConfig
- type AURPublisher
- func (p *AURPublisher) Name() string
- func (p *AURPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- func (p *AURPublisher) Supports(target string) bool
- func (p *AURPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- type ChecksumMap
- type ChocolateyConfig
- type ChocolateyPublisher
- func (p *ChocolateyPublisher) Name() string
- func (p *ChocolateyPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- func (p *ChocolateyPublisher) Supports(target string) bool
- func (p *ChocolateyPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- type DockerConfig
- type DockerPublisher
- func (p *DockerPublisher) Name() string
- func (p *DockerPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- func (p *DockerPublisher) Supports(target string) bool
- func (p *DockerPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- type GitHubPublisher
- func (p *GitHubPublisher) Name() string
- func (p *GitHubPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- func (p *GitHubPublisher) Supports(target string) bool
- func (p *GitHubPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- type HomebrewConfig
- type HomebrewPublisher
- func (p *HomebrewPublisher) Name() string
- func (p *HomebrewPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- func (p *HomebrewPublisher) Supports(target string) bool
- func (p *HomebrewPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- type LinuxKitConfig
- type LinuxKitPublisher
- func (p *LinuxKitPublisher) Name() string
- func (p *LinuxKitPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- func (p *LinuxKitPublisher) Supports(target string) bool
- func (p *LinuxKitPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- type LinuxKitTarget
- type NpmConfig
- type NpmPublisher
- func (p *NpmPublisher) Name() string
- func (p *NpmPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- func (p *NpmPublisher) Supports(target string) bool
- func (p *NpmPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- type OfficialConfig
- type Publisher
- type PublisherConfig
- type Release
- type ReleaseConfig
- type ScoopConfig
- type ScoopPublisher
- func (p *ScoopPublisher) Name() string
- func (p *ScoopPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
- func (p *ScoopPublisher) Supports(target string) bool
- func (p *ScoopPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, ...) core.Result
Examples ¶
- AURPublisher.Name
- AURPublisher.Publish
- AURPublisher.Supports
- AURPublisher.Validate
- ChecksumMap
- ChocolateyPublisher.Name
- ChocolateyPublisher.Publish
- ChocolateyPublisher.Supports
- ChocolateyPublisher.Validate
- DeleteRelease
- DetectGitHubRepository
- DockerPublisher.Name
- DockerPublisher.Publish
- DockerPublisher.Supports
- DockerPublisher.Validate
- GitHubPublisher.Name
- GitHubPublisher.Publish
- GitHubPublisher.Supports
- GitHubPublisher.Validate
- HomebrewPublisher.Name
- HomebrewPublisher.Publish
- HomebrewPublisher.Supports
- HomebrewPublisher.Validate
- LinuxKitPublisher.Name
- LinuxKitPublisher.Publish
- LinuxKitPublisher.Supports
- LinuxKitPublisher.Validate
- NewAURPublisher
- NewChocolateyPublisher
- NewDockerPublisher
- NewGitHubPublisher
- NewHomebrewPublisher
- NewLinuxKitPublisher
- NewNpmPublisher
- NewPublisherConfig
- NewRelease
- NewReleaseWithArtifactFS
- NewScoopPublisher
- NpmPublisher.Name
- NpmPublisher.Publish
- NpmPublisher.Supports
- NpmPublisher.Validate
- ReleaseExists
- ScoopPublisher.Name
- ScoopPublisher.Publish
- ScoopPublisher.Supports
- ScoopPublisher.Validate
- UploadArtifact
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteRelease ¶
DeleteRelease deletes a release by tag name.
result := publishers.DeleteRelease(ctx, "host-uk/core-build", "v1.2.3")
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
_ = DeleteRelease(ctx, "owner/repo", "v1.2.3")
core.Println("DeleteRelease")
Output: DeleteRelease
func DetectGitHubRepository ¶
DetectGitHubRepository detects the owner/repo pair from any GitHub remote in the repository. Repositories that use Forge or another self-hosted origin can still resolve against a secondary `github` remote.
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
_ = DetectGitHubRepository(ctx, core.Path(core.TempDir(), "go-build-compliance"))
core.Println("DetectGitHubRepository")
Output: DetectGitHubRepository
func ReleaseExists ¶
ReleaseExists checks if a release exists for the given version.
exists := publishers.ReleaseExists(ctx, "host-uk/core-build", "v1.2.3")
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
_ = ReleaseExists(ctx, "owner/repo", "v1.2.3")
core.Println("ReleaseExists")
Output: ReleaseExists
func UploadArtifact ¶
UploadArtifact uploads a single artifact to an existing release. This can be used to add artifacts to a release after creation.
result := publishers.UploadArtifact(ctx, "host-uk/core-build", "v1.2.3", "dist/core-build_v1.2.3_linux_amd64.tar.gz")
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
_ = UploadArtifact(ctx, "owner/repo", "v1.2.3", core.Path(core.TempDir(), "go-build-compliance"))
core.Println("UploadArtifact")
Output: UploadArtifact
Types ¶
type AURConfig ¶
type AURConfig struct {
// Package is the AUR package name.
Package string
// Maintainer is the package maintainer (e.g., "Name <email>").
Maintainer string
// Official config for generating files for official repo PRs.
Official *OfficialConfig
}
AURConfig holds AUR-specific configuration.
cfg := publishers.AURConfig{Package: "core-build", Maintainer: "Jane Doe <jane@example.com>"}
type AURPublisher ¶
type AURPublisher struct{}
AURPublisher publishes releases to AUR.
pub := publishers.NewAURPublisher()
func NewAURPublisher ¶
func NewAURPublisher() *AURPublisher
NewAURPublisher creates a new AUR publisher.
pub := publishers.NewAURPublisher()
Example ¶
--- v0.9.0 generated usage examples ---
_ = NewAURPublisher()
core.Println("NewAURPublisher")
Output: NewAURPublisher
func (*AURPublisher) Name ¶
func (p *AURPublisher) Name() string
Name returns the publisher's identifier.
name := pub.Name() // → "aur"
Example ¶
subject := &AURPublisher{}
_ = subject.Name()
core.Println("AURPublisher_Name")
Output: AURPublisher_Name
func (*AURPublisher) Publish ¶
func (p *AURPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) core.Result
Publish publishes the release to AUR.
result := pub.Publish(ctx, rel, pubCfg, relCfg, false)
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &AURPublisher{}
_ = subject.Publish(ctx, &Release{}, PublisherConfig{}, nil, true)
core.Println("AURPublisher_Publish")
Output: AURPublisher_Publish
func (*AURPublisher) Supports ¶
func (p *AURPublisher) Supports(target string) bool
Supports reports whether the publisher handles the requested target.
Example ¶
subject := &AURPublisher{}
_ = subject.Supports("linux")
core.Println("AURPublisher_Supports")
Output: AURPublisher_Supports
func (*AURPublisher) Validate ¶
func (p *AURPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig) core.Result
Validate checks the AUR publisher configuration before publishing.
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &AURPublisher{}
_ = subject.Validate(ctx, &Release{}, PublisherConfig{}, nil)
core.Println("AURPublisher_Validate")
Output: AURPublisher_Validate
type ChecksumMap ¶
type ChecksumMap struct {
DarwinAmd64 string
DarwinArm64 string
LinuxAmd64 string
LinuxArm64 string
WindowsAmd64 string
WindowsArm64 string
DarwinAmd64File string
DarwinArm64File string
LinuxAmd64File string
LinuxArm64File string
WindowsAmd64File string
WindowsArm64File string
ChecksumFile string
}
ChecksumMap holds resolved release asset names and SHA-256 checksums for the platform archives publishers reference in generated package metadata.
Example ¶
checksums := ChecksumMap{
LinuxAmd64File: "app_linux_amd64.tar.gz",
LinuxAmd64: "sha256",
}
core.Println(checksums.LinuxAmd64File, checksums.LinuxAmd64)
Output: app_linux_amd64.tar.gz sha256
type ChocolateyConfig ¶
type ChocolateyConfig struct {
// Package is the Chocolatey package name.
Package string
// Push determines whether to push to Chocolatey (false = generate only).
Push bool
// Official config for generating files for official repo PRs.
Official *OfficialConfig
}
ChocolateyConfig holds Chocolatey-specific configuration.
cfg := publishers.ChocolateyConfig{Package: "core-build", Push: true}
type ChocolateyPublisher ¶
type ChocolateyPublisher struct{}
ChocolateyPublisher publishes releases to Chocolatey.
pub := publishers.NewChocolateyPublisher()
func NewChocolateyPublisher ¶
func NewChocolateyPublisher() *ChocolateyPublisher
NewChocolateyPublisher creates a new Chocolatey publisher.
pub := publishers.NewChocolateyPublisher()
Example ¶
--- v0.9.0 generated usage examples ---
_ = NewChocolateyPublisher()
core.Println("NewChocolateyPublisher")
Output: NewChocolateyPublisher
func (*ChocolateyPublisher) Name ¶
func (p *ChocolateyPublisher) Name() string
Name returns the publisher's identifier.
name := pub.Name() // → "chocolatey"
Example ¶
subject := &ChocolateyPublisher{}
_ = subject.Name()
core.Println("ChocolateyPublisher_Name")
Output: ChocolateyPublisher_Name
func (*ChocolateyPublisher) Publish ¶
func (p *ChocolateyPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) core.Result
Publish publishes the release to Chocolatey.
result := pub.Publish(ctx, rel, pubCfg, relCfg, false)
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &ChocolateyPublisher{}
_ = subject.Publish(ctx, &Release{}, PublisherConfig{}, nil, true)
core.Println("ChocolateyPublisher_Publish")
Output: ChocolateyPublisher_Publish
func (*ChocolateyPublisher) Supports ¶
func (p *ChocolateyPublisher) Supports(target string) bool
Supports reports whether the publisher handles the requested target.
Example ¶
subject := &ChocolateyPublisher{}
_ = subject.Supports("linux")
core.Println("ChocolateyPublisher_Supports")
Output: ChocolateyPublisher_Supports
func (*ChocolateyPublisher) Validate ¶
func (p *ChocolateyPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig) core.Result
Validate checks that the Chocolatey publisher has a release to publish.
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &ChocolateyPublisher{}
_ = subject.Validate(ctx, &Release{}, PublisherConfig{}, nil)
core.Println("ChocolateyPublisher_Validate")
Output: ChocolateyPublisher_Validate
type DockerConfig ¶
type DockerConfig struct {
// Registry is the container registry (default: ghcr.io).
Registry string `yaml:"registry"`
// Image is the image name in owner/repo format.
Image string `yaml:"image"`
// Dockerfile is the path to the Dockerfile (default: Dockerfile).
Dockerfile string `yaml:"dockerfile"`
// Platforms are the target platforms (linux/amd64, linux/arm64).
Platforms []string `yaml:"platforms"`
// Tags are additional tags to apply (supports {{.Version}} template).
Tags []string `yaml:"tags"`
// BuildArgs are additional build arguments.
BuildArgs map[string]string `yaml:"build_args"`
}
DockerConfig holds configuration for the Docker publisher.
cfg := publishers.DockerConfig{Registry: "ghcr.io", Image: "host-uk/core-build", Platforms: []string{"linux/amd64", "linux/arm64"}}
type DockerPublisher ¶
type DockerPublisher struct{}
DockerPublisher builds and publishes Docker images.
pub := publishers.NewDockerPublisher()
func NewDockerPublisher ¶
func NewDockerPublisher() *DockerPublisher
NewDockerPublisher creates a new Docker publisher.
pub := publishers.NewDockerPublisher()
Example ¶
--- v0.9.0 generated usage examples ---
_ = NewDockerPublisher()
core.Println("NewDockerPublisher")
Output: NewDockerPublisher
func (*DockerPublisher) Name ¶
func (p *DockerPublisher) Name() string
Name returns the publisher's identifier.
name := pub.Name() // → "docker"
Example ¶
subject := &DockerPublisher{}
_ = subject.Name()
core.Println("DockerPublisher_Name")
Output: DockerPublisher_Name
func (*DockerPublisher) Publish ¶
func (p *DockerPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) core.Result
Publish builds and pushes Docker images.
result := pub.Publish(ctx, rel, pubCfg, relCfg, false)
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &DockerPublisher{}
_ = subject.Publish(ctx, &Release{}, PublisherConfig{}, nil, true)
core.Println("DockerPublisher_Publish")
Output: DockerPublisher_Publish
func (*DockerPublisher) Supports ¶
func (p *DockerPublisher) Supports(target string) bool
Supports reports whether the publisher handles the requested target.
Example ¶
subject := &DockerPublisher{}
_ = subject.Supports("linux")
core.Println("DockerPublisher_Supports")
Output: DockerPublisher_Supports
func (*DockerPublisher) Validate ¶
func (p *DockerPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig) core.Result
Validate checks the Docker publisher configuration before publishing.
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &DockerPublisher{}
_ = subject.Validate(ctx, &Release{}, PublisherConfig{}, nil)
core.Println("DockerPublisher_Validate")
Output: DockerPublisher_Validate
type GitHubPublisher ¶
type GitHubPublisher struct{}
GitHubPublisher publishes releases to GitHub using the gh CLI.
pub := publishers.NewGitHubPublisher()
func NewGitHubPublisher ¶
func NewGitHubPublisher() *GitHubPublisher
NewGitHubPublisher creates a new GitHub publisher.
pub := publishers.NewGitHubPublisher()
Example ¶
--- v0.9.0 generated usage examples ---
_ = NewGitHubPublisher()
core.Println("NewGitHubPublisher")
Output: NewGitHubPublisher
func (*GitHubPublisher) Name ¶
func (p *GitHubPublisher) Name() string
Name returns the publisher's identifier.
name := pub.Name() // → "github"
Example ¶
subject := &GitHubPublisher{}
_ = subject.Name()
core.Println("GitHubPublisher_Name")
Output: GitHubPublisher_Name
func (*GitHubPublisher) Publish ¶
func (p *GitHubPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) core.Result
Publish publishes the release to GitHub using the gh CLI.
result := pub.Publish(ctx, rel, pubCfg, relCfg, false) // dryRun=true to preview
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &GitHubPublisher{}
_ = subject.Publish(ctx, &Release{}, PublisherConfig{}, nil, true)
core.Println("GitHubPublisher_Publish")
Output: GitHubPublisher_Publish
func (*GitHubPublisher) Supports ¶
func (p *GitHubPublisher) Supports(target string) bool
Supports reports whether the publisher handles the requested target.
Example ¶
subject := &GitHubPublisher{}
_ = subject.Supports("linux")
core.Println("GitHubPublisher_Supports")
Output: GitHubPublisher_Supports
func (*GitHubPublisher) Validate ¶
func (p *GitHubPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig) core.Result
Validate checks that the GitHub publisher has a release to publish.
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &GitHubPublisher{}
_ = subject.Validate(ctx, &Release{}, PublisherConfig{}, nil)
core.Println("GitHubPublisher_Validate")
Output: GitHubPublisher_Validate
type HomebrewConfig ¶
type HomebrewConfig struct {
// Tap is the Homebrew tap repository (e.g., "host-uk/homebrew-tap").
Tap string
// Formula is the formula name (defaults to project name).
Formula string
// Official config for generating files for official repo PRs.
Official *OfficialConfig
}
HomebrewConfig holds Homebrew-specific configuration.
cfg := publishers.HomebrewConfig{Tap: "host-uk/homebrew-tap", Formula: "core-build"}
type HomebrewPublisher ¶
type HomebrewPublisher struct{}
HomebrewPublisher publishes releases to Homebrew.
pub := publishers.NewHomebrewPublisher()
func NewHomebrewPublisher ¶
func NewHomebrewPublisher() *HomebrewPublisher
NewHomebrewPublisher creates a new Homebrew publisher.
pub := publishers.NewHomebrewPublisher()
Example ¶
--- v0.9.0 generated usage examples ---
_ = NewHomebrewPublisher()
core.Println("NewHomebrewPublisher")
Output: NewHomebrewPublisher
func (*HomebrewPublisher) Name ¶
func (p *HomebrewPublisher) Name() string
Name returns the publisher's identifier.
name := pub.Name() // → "homebrew"
Example ¶
subject := &HomebrewPublisher{}
_ = subject.Name()
core.Println("HomebrewPublisher_Name")
Output: HomebrewPublisher_Name
func (*HomebrewPublisher) Publish ¶
func (p *HomebrewPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) core.Result
Publish publishes the release to Homebrew.
result := pub.Publish(ctx, rel, pubCfg, relCfg, false)
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &HomebrewPublisher{}
_ = subject.Publish(ctx, &Release{}, PublisherConfig{}, nil, true)
core.Println("HomebrewPublisher_Publish")
Output: HomebrewPublisher_Publish
func (*HomebrewPublisher) Supports ¶
func (p *HomebrewPublisher) Supports(target string) bool
Supports reports whether the publisher handles the requested target.
Example ¶
subject := &HomebrewPublisher{}
_ = subject.Supports("linux")
core.Println("HomebrewPublisher_Supports")
Output: HomebrewPublisher_Supports
func (*HomebrewPublisher) Validate ¶
func (p *HomebrewPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig) core.Result
Validate checks the Homebrew publisher configuration before publishing.
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &HomebrewPublisher{}
_ = subject.Validate(ctx, &Release{}, PublisherConfig{}, nil)
core.Println("HomebrewPublisher_Validate")
Output: HomebrewPublisher_Validate
type LinuxKitConfig ¶
type LinuxKitConfig struct {
// Config is the path to the LinuxKit YAML configuration file.
Config string `yaml:"config"`
// Formats are the output formats to build.
// Supported: iso, iso-bios, iso-efi, raw, raw-bios, raw-efi,
// qcow2, qcow2-bios, qcow2-efi, vmdk, vhd, gcp, aws,
// docker (tarball for `docker load`), tar, kernel+initrd
Formats []string `yaml:"formats"`
// Platforms are the target platforms (linux/amd64, linux/arm64).
Platforms []string `yaml:"platforms"`
// Targets describe optional cloud upload targets for cloud image formats.
Targets []LinuxKitTarget `yaml:"targets"`
}
LinuxKitConfig holds configuration for the LinuxKit publisher.
cfg := publishers.LinuxKitConfig{Config: ".core/node.yaml", Formats: []string{"iso", "qcow2"}}
type LinuxKitPublisher ¶
type LinuxKitPublisher struct{}
LinuxKitPublisher builds and publishes LinuxKit images.
pub := publishers.NewLinuxKitPublisher()
func NewLinuxKitPublisher ¶
func NewLinuxKitPublisher() *LinuxKitPublisher
NewLinuxKitPublisher creates a new LinuxKit publisher.
pub := publishers.NewLinuxKitPublisher()
Example ¶
--- v0.9.0 generated usage examples ---
_ = NewLinuxKitPublisher()
core.Println("NewLinuxKitPublisher")
Output: NewLinuxKitPublisher
func (*LinuxKitPublisher) Name ¶
func (p *LinuxKitPublisher) Name() string
Name returns the publisher's identifier.
name := pub.Name() // → "linuxkit"
Example ¶
subject := &LinuxKitPublisher{}
_ = subject.Name()
core.Println("LinuxKitPublisher_Name")
Output: LinuxKitPublisher_Name
func (*LinuxKitPublisher) Publish ¶
func (p *LinuxKitPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) core.Result
Publish builds LinuxKit images and routes them by output format.
result := pub.Publish(ctx, rel, pubCfg, relCfg, false)
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &LinuxKitPublisher{}
_ = subject.Publish(ctx, &Release{}, PublisherConfig{}, nil, true)
core.Println("LinuxKitPublisher_Publish")
Output: LinuxKitPublisher_Publish
func (*LinuxKitPublisher) Supports ¶
func (p *LinuxKitPublisher) Supports(target string) bool
Supports reports whether the publisher handles the requested target.
Example ¶
subject := &LinuxKitPublisher{}
_ = subject.Supports("linux")
core.Println("LinuxKitPublisher_Supports")
Output: LinuxKitPublisher_Supports
func (*LinuxKitPublisher) Validate ¶
func (p *LinuxKitPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig) core.Result
Validate checks the LinuxKit publisher configuration before publishing.
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &LinuxKitPublisher{}
_ = subject.Validate(ctx, &Release{}, PublisherConfig{}, nil)
core.Println("LinuxKitPublisher_Validate")
Output: LinuxKitPublisher_Validate
type LinuxKitTarget ¶
type LinuxKitTarget struct {
// Name is an optional target name.
Name string `json:"name" yaml:"name"`
// Type is the target type (aws, gcp, s3, gcs).
Type string `json:"type" yaml:"type"`
// Provider is the cloud provider (aws or gcp).
Provider string `json:"provider" yaml:"provider"`
// Bucket is the destination bucket name.
Bucket string `json:"bucket" yaml:"bucket"`
// Prefix is the object key prefix inside the bucket.
Prefix string `json:"prefix" yaml:"prefix"`
// Region is the AWS region for S3 uploads.
Region string `json:"region" yaml:"region"`
}
LinuxKitTarget describes a cloud upload target for LinuxKit images.
type NpmConfig ¶
type NpmConfig struct {
// Package is the npm package name (e.g., "@host-uk/core").
Package string
// Access is the npm access level: "public" or "restricted".
Access string
}
NpmConfig holds npm-specific configuration.
cfg := publishers.NpmConfig{Package: "@host-uk/core-build", Access: "public"}
type NpmPublisher ¶
type NpmPublisher struct{}
NpmPublisher publishes releases to npm using the binary wrapper pattern.
pub := publishers.NewNpmPublisher()
func NewNpmPublisher ¶
func NewNpmPublisher() *NpmPublisher
NewNpmPublisher creates a new npm publisher.
pub := publishers.NewNpmPublisher()
Example ¶
--- v0.9.0 generated usage examples ---
_ = NewNpmPublisher()
core.Println("NewNpmPublisher")
Output: NewNpmPublisher
func (*NpmPublisher) Name ¶
func (p *NpmPublisher) Name() string
Name returns the publisher's identifier.
name := pub.Name() // → "npm"
Example ¶
subject := &NpmPublisher{}
_ = subject.Name()
core.Println("NpmPublisher_Name")
Output: NpmPublisher_Name
func (*NpmPublisher) Publish ¶
func (p *NpmPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) core.Result
Publish publishes the release to npm as a binary wrapper package.
result := pub.Publish(ctx, rel, pubCfg, relCfg, false)
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &NpmPublisher{}
_ = subject.Publish(ctx, &Release{}, PublisherConfig{}, nil, true)
core.Println("NpmPublisher_Publish")
Output: NpmPublisher_Publish
func (*NpmPublisher) Supports ¶
func (p *NpmPublisher) Supports(target string) bool
Supports reports whether the publisher handles the requested target.
Example ¶
subject := &NpmPublisher{}
_ = subject.Supports("linux")
core.Println("NpmPublisher_Supports")
Output: NpmPublisher_Supports
func (*NpmPublisher) Validate ¶
func (p *NpmPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig) core.Result
Validate checks the npm publisher configuration before publishing.
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &NpmPublisher{}
_ = subject.Validate(ctx, &Release{}, PublisherConfig{}, nil)
core.Println("NpmPublisher_Validate")
Output: NpmPublisher_Validate
type OfficialConfig ¶
type OfficialConfig struct {
// Enabled determines whether to generate files for official repos.
Enabled bool
// Output is the directory to write generated files.
Output string
}
OfficialConfig holds configuration for generating files for official repo PRs.
cfg.Official = &publishers.OfficialConfig{Enabled: true, Output: "dist/homebrew"}
type Publisher ¶
type Publisher interface {
// Name returns the publisher's identifier.
Name() string
// Validate checks the runtime release and publisher configuration before publish.
Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig) core.Result
// Publish publishes the release to the target.
// If dryRun is true, it prints what would be done without executing.
Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) core.Result
// Supports reports whether the publisher handles the named target.
Supports(target string) bool
}
Publisher defines the interface for release publishers.
var pub publishers.Publisher = publishers.NewGitHubPublisher()
type PublisherConfig ¶
type PublisherConfig struct {
// Type is the publisher type (e.g., "github", "linuxkit", "docker").
Type string
// Prerelease marks the release as a prerelease.
Prerelease bool
// Draft creates the release as a draft.
Draft bool
// Extended holds publisher-specific configuration.
Extended any
}
PublisherConfig holds configuration for a publisher.
cfg := publishers.NewPublisherConfig("github", false, false, nil)
func NewPublisherConfig ¶
func NewPublisherConfig(pubType string, prerelease, draft bool, extended any) PublisherConfig
NewPublisherConfig creates a PublisherConfig.
cfg := publishers.NewPublisherConfig("github", false, false, nil)
Example ¶
_ = NewPublisherConfig("agent", true, true, "agent")
core.Println("NewPublisherConfig")
Output: NewPublisherConfig
type Release ¶
type Release struct {
// Version is the semantic version string (e.g., "v1.2.3").
Version string
// Artifacts are the built release artifacts.
Artifacts []build.Artifact
// Changelog is the generated markdown changelog.
Changelog string
// ProjectDir is the root directory of the project.
ProjectDir string
// FS is the project filesystem used for local project file access.
FS storage.Medium
// ArtifactFS is the medium backing the release artifact paths.
ArtifactFS storage.Medium
}
Release represents a release to be published.
rel := publishers.NewRelease("v1.2.3", artifacts, changelog, ".", storage.Local)
func NewRelease ¶
func NewRelease(version string, artifacts []build.Artifact, changelog, projectDir string, fs storage.Medium) *Release
NewRelease creates a Release from the release package's Release type. This is a helper to convert between packages.
rel := publishers.NewRelease("v1.2.3", artifacts, changelog, ".", storage.Local)
Example ¶
--- v0.9.0 generated usage examples ---
_ = NewRelease("v1.2.3", nil, "agent", core.Path(core.TempDir(), "go-build-compliance"), coreio.NewMemoryMedium())
core.Println("NewRelease")
Output: NewRelease
func NewReleaseWithArtifactFS ¶
func NewReleaseWithArtifactFS(version string, artifacts []build.Artifact, changelog, projectDir string, fs storage.Medium, artifactFS storage.Medium) *Release
NewReleaseWithArtifactFS creates a Release with explicit project and artifact media.
rel := publishers.NewReleaseWithArtifactFS("v1.2.3", artifacts, changelog, ".", storage.Local, storage.NewMemoryMedium())
Example ¶
_ = NewReleaseWithArtifactFS("v1.2.3", nil, "agent", core.Path(core.TempDir(), "go-build-compliance"), coreio.NewMemoryMedium(), coreio.NewMemoryMedium())
core.Println("NewReleaseWithArtifactFS")
Output: NewReleaseWithArtifactFS
type ReleaseConfig ¶
ReleaseConfig holds release configuration needed by publishers.
var relCfg publishers.ReleaseConfig = cfg // *release.Config implements this interface
type ScoopConfig ¶
type ScoopConfig struct {
// Bucket is the Scoop bucket repository (e.g., "host-uk/scoop-bucket").
Bucket string
// Official config for generating files for official repo PRs.
Official *OfficialConfig
}
ScoopConfig holds Scoop-specific configuration.
cfg := publishers.ScoopConfig{Bucket: "host-uk/scoop-bucket"}
type ScoopPublisher ¶
type ScoopPublisher struct{}
ScoopPublisher publishes releases to Scoop.
pub := publishers.NewScoopPublisher()
func NewScoopPublisher ¶
func NewScoopPublisher() *ScoopPublisher
NewScoopPublisher creates a new Scoop publisher.
pub := publishers.NewScoopPublisher()
Example ¶
--- v0.9.0 generated usage examples ---
_ = NewScoopPublisher()
core.Println("NewScoopPublisher")
Output: NewScoopPublisher
func (*ScoopPublisher) Name ¶
func (p *ScoopPublisher) Name() string
Name returns the publisher's identifier.
name := pub.Name() // → "scoop"
Example ¶
subject := &ScoopPublisher{}
_ = subject.Name()
core.Println("ScoopPublisher_Name")
Output: ScoopPublisher_Name
func (*ScoopPublisher) Publish ¶
func (p *ScoopPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) core.Result
Publish publishes the release to Scoop.
result := pub.Publish(ctx, rel, pubCfg, relCfg, false)
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &ScoopPublisher{}
_ = subject.Publish(ctx, &Release{}, PublisherConfig{}, nil, true)
core.Println("ScoopPublisher_Publish")
Output: ScoopPublisher_Publish
func (*ScoopPublisher) Supports ¶
func (p *ScoopPublisher) Supports(target string) bool
Supports reports whether the publisher handles the requested target.
Example ¶
subject := &ScoopPublisher{}
_ = subject.Supports("linux")
core.Println("ScoopPublisher_Supports")
Output: ScoopPublisher_Supports
func (*ScoopPublisher) Validate ¶
func (p *ScoopPublisher) Validate(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig) core.Result
Validate checks the Scoop publisher configuration before publishing.
Example ¶
ctx, cancel := core.WithCancel(core.Background())
cancel()
subject := &ScoopPublisher{}
_ = subject.Validate(ctx, &Release{}, PublisherConfig{}, nil)
core.Println("ScoopPublisher_Validate")
Output: ScoopPublisher_Validate