Documentation
¶
Index ¶
- Constants
- Variables
- func CrossCompile(tmpDir string, cmds []string, targets []CrossTarget, repoDir string) ([]string, error)
- func LatestReleaseTag() (string, error)
- func ParseReleaseArgs(args []string) (tag string, isHelp bool)
- func Sync(path string, a Action) (changed bool, err error)
- type Action
- type Branding
- type CrossTarget
- type GitClient
- type GitHubClient
- type Gorelease
- func (g *Gorelease) CrossCompileWithTag(tmpDir string, cmds []string, targets []CrossTarget, repoDir, tag string) ([]string, error)
- func (g *Gorelease) ReleaseOnly(tag string, gh GitHubClient) error
- func (g *Gorelease) SetConsoleOutput(fn func(string))
- func (g *Gorelease) SetCrossCompileFn(...)
- func (g *Gorelease) SetLog(fn func(...any))
- func (g *Gorelease) SetRootDir(path string)
- type Input
- type KeyValue
- type Output
- type Step
Constants ¶
const ( ActionFilePath = "action.yml" ReleaseAssetURLFmt = "https://github.com/tinywasm/gorelease/releases/download/%s/%s" )
const HeaderGenerated = `` /* 163-byte string literal not displayed */
Variables ¶
var Version = "v0.0.0"
Version is injected at build time via -ldflags="-X main.Version=...". It is also used by `gorelease version` output.
Functions ¶
func CrossCompile ¶ added in v0.1.0
func CrossCompile(tmpDir string, cmds []string, targets []CrossTarget, repoDir string) ([]string, error)
CrossCompile builds the specified commands for multiple platforms.
func LatestReleaseTag ¶ added in v0.1.0
LatestReleaseTag returns the highest semver tag in the repository.
func ParseReleaseArgs ¶ added in v0.1.0
ParseReleaseArgs parses gorelease CLI: gorelease [tag] Returns tag (may be empty) and isHelp.
Types ¶
type Action ¶ added in v0.1.0
type Action struct {
Name string
Description string
Author string
Branding Branding
Header string
Inputs []Input
Outputs []Output
Steps []Step
}
func GoreleaseAction ¶ added in v0.1.0
GoreleaseAction builds the description of the gorelease action.
type CrossTarget ¶ added in v0.1.0
type CrossTarget struct{ GOOS, GOARCH string }
CrossTarget represents a compilation target platform.
func DefaultTargets ¶ added in v0.1.0
func DefaultTargets() []CrossTarget
DefaultTargets returns the standard set of platforms for release.
type GitHubClient ¶ added in v0.1.0
type GitHubClient interface {
RepoInfo(repoRef string) (owner, name, visibility string, err error)
CreateRelease(tag string, assets []string, targetRepo string) (string, error)
}
GitHubClient is the minimal GitHub interface needed by ReleaseOnly.
type Gorelease ¶
type Gorelease struct {
// contains filtered or unexported fields
}
Gorelease orchestrates cross-compilation and GitHub Release creation.
func (*Gorelease) CrossCompileWithTag ¶ added in v0.1.0
func (g *Gorelease) CrossCompileWithTag(tmpDir string, cmds []string, targets []CrossTarget, repoDir, tag string) ([]string, error)
CrossCompileWithTag builds the specified commands for multiple platforms with version injection.
func (*Gorelease) ReleaseOnly ¶ added in v0.1.0
func (g *Gorelease) ReleaseOnly(tag string, gh GitHubClient) error
ReleaseOnly creates a GitHub Release with cross-platform binaries for an existing tag. If tag is empty, it uses the latest tag from git.GetLatestTag().
func (*Gorelease) SetConsoleOutput ¶ added in v0.1.0
SetConsoleOutput sets the function for console output.
func (*Gorelease) SetCrossCompileFn ¶ added in v0.1.0
func (g *Gorelease) SetCrossCompileFn(fn func(tmpDir string, cmds []string, targets []CrossTarget, repoDir string) ([]string, error))
SetCrossCompileFn sets a custom cross-compile function for testing.
func (*Gorelease) SetRootDir ¶ added in v0.1.0
SetRootDir sets the root directory for operations.