publishers

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2026 License: EUPL-1.2 Imports: 11 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteRelease

func DeleteRelease(ctx context.Context, repo, version string) error

DeleteRelease deletes a release by tag name.

func ReleaseExists

func ReleaseExists(ctx context.Context, repo, version string) bool

ReleaseExists checks if a release exists for the given version.

func UploadArtifact

func UploadArtifact(ctx context.Context, repo, version, artifactPath string) error

UploadArtifact uploads a single artifact to an existing release. This can be used to add artifacts to a release after creation.

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.

type AURPublisher

type AURPublisher struct{}

AURPublisher publishes releases to AUR.

func NewAURPublisher

func NewAURPublisher() *AURPublisher

NewAURPublisher creates a new AUR publisher.

func (*AURPublisher) Name

func (p *AURPublisher) Name() string

Name returns the publisher's identifier.

func (*AURPublisher) Publish

func (p *AURPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) error

Publish publishes the release to AUR.

type ChecksumMap

type ChecksumMap struct {
	DarwinAmd64  string
	DarwinArm64  string
	LinuxAmd64   string
	LinuxArm64   string
	WindowsAmd64 string
	WindowsArm64 string
}

ChecksumMap holds checksums for different platform/arch combinations.

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.

type ChocolateyPublisher

type ChocolateyPublisher struct{}

ChocolateyPublisher publishes releases to Chocolatey.

func NewChocolateyPublisher

func NewChocolateyPublisher() *ChocolateyPublisher

NewChocolateyPublisher creates a new Chocolatey publisher.

func (*ChocolateyPublisher) Name

func (p *ChocolateyPublisher) Name() string

Name returns the publisher's identifier.

func (*ChocolateyPublisher) Publish

func (p *ChocolateyPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) error

Publish publishes the release to Chocolatey.

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.

type DockerPublisher

type DockerPublisher struct{}

DockerPublisher builds and publishes Docker images.

func NewDockerPublisher

func NewDockerPublisher() *DockerPublisher

NewDockerPublisher creates a new Docker publisher.

func (*DockerPublisher) Name

func (p *DockerPublisher) Name() string

Name returns the publisher's identifier.

func (*DockerPublisher) Publish

func (p *DockerPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) error

Publish builds and pushes Docker images.

type GitHubPublisher

type GitHubPublisher struct{}

GitHubPublisher publishes releases to GitHub using the gh CLI.

func NewGitHubPublisher

func NewGitHubPublisher() *GitHubPublisher

NewGitHubPublisher creates a new GitHub publisher.

func (*GitHubPublisher) Name

func (p *GitHubPublisher) Name() string

Name returns the publisher's identifier.

func (*GitHubPublisher) Publish

func (p *GitHubPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) error

Publish publishes the release to GitHub. Uses the gh CLI for creating releases and uploading assets.

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.

type HomebrewPublisher

type HomebrewPublisher struct{}

HomebrewPublisher publishes releases to Homebrew.

func NewHomebrewPublisher

func NewHomebrewPublisher() *HomebrewPublisher

NewHomebrewPublisher creates a new Homebrew publisher.

func (*HomebrewPublisher) Name

func (p *HomebrewPublisher) Name() string

Name returns the publisher's identifier.

func (*HomebrewPublisher) Publish

func (p *HomebrewPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) error

Publish publishes the release to Homebrew.

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"`
}

LinuxKitConfig holds configuration for the LinuxKit publisher.

type LinuxKitPublisher

type LinuxKitPublisher struct{}

LinuxKitPublisher builds and publishes LinuxKit images.

func NewLinuxKitPublisher

func NewLinuxKitPublisher() *LinuxKitPublisher

NewLinuxKitPublisher creates a new LinuxKit publisher.

func (*LinuxKitPublisher) Name

func (p *LinuxKitPublisher) Name() string

Name returns the publisher's identifier.

func (*LinuxKitPublisher) Publish

func (p *LinuxKitPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) error

Publish builds LinuxKit images and uploads them to the GitHub release.

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.

type NpmPublisher

type NpmPublisher struct{}

NpmPublisher publishes releases to npm using the binary wrapper pattern.

func NewNpmPublisher

func NewNpmPublisher() *NpmPublisher

NewNpmPublisher creates a new npm publisher.

func (*NpmPublisher) Name

func (p *NpmPublisher) Name() string

Name returns the publisher's identifier.

func (*NpmPublisher) Publish

func (p *NpmPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) error

Publish publishes the release to npm. It generates a binary wrapper package that downloads the correct platform binary on postinstall.

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.

type Publisher

type Publisher interface {
	// Name returns the publisher's identifier.
	Name() string
	// 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) error
}

Publisher defines the interface for release publishers.

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.

func NewPublisherConfig

func NewPublisherConfig(pubType string, prerelease, draft bool, extended any) PublisherConfig

NewPublisherConfig creates a PublisherConfig.

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
}

Release represents a release to be published.

func NewRelease

func NewRelease(version string, artifacts []build.Artifact, changelog, projectDir string) *Release

NewRelease creates a Release from the release package's Release type. This is a helper to convert between packages.

type ReleaseConfig

type ReleaseConfig interface {
	GetRepository() string
	GetProjectName() string
}

ReleaseConfig holds release configuration needed by publishers.

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.

type ScoopPublisher

type ScoopPublisher struct{}

ScoopPublisher publishes releases to Scoop.

func NewScoopPublisher

func NewScoopPublisher() *ScoopPublisher

NewScoopPublisher creates a new Scoop publisher.

func (*ScoopPublisher) Name

func (p *ScoopPublisher) Name() string

Name returns the publisher's identifier.

func (*ScoopPublisher) Publish

func (p *ScoopPublisher) Publish(ctx context.Context, release *Release, pubCfg PublisherConfig, relCfg ReleaseConfig, dryRun bool) error

Publish publishes the release to Scoop.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL