Documentation
¶
Index ¶
- func FindLatestVersion(tags []string) string
- func IsSemver(s string) bool
- func NextMajorVersion(current string) (string, error)
- func NextMinorVersion(current string) (string, error)
- func NextPatchVersion(current string) (string, error)
- type GitHubReleaser
- func (r *GitHubReleaser) CreateRelease(ctx context.Context, req *model.ReleaseRequest) (*model.Release, error)
- func (r *GitHubReleaser) CreateTag(ctx context.Context, repo model.RepoRef, tagName, sha, message string) error
- func (r *GitHubReleaser) GetDefaultBranchSHA(ctx context.Context, repo model.RepoRef, branch string) (string, error)
- func (r *GitHubReleaser) GetLatestTag(ctx context.Context, repo model.RepoRef) (string, error)
- func (r *GitHubReleaser) GetTagSHA(ctx context.Context, repo model.RepoRef, tagName string) (string, error)
- type Options
- type Releaser
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindLatestVersion ¶
FindLatestVersion finds the highest semver version from a list of tags.
func NextMajorVersion ¶
NextMajorVersion returns the next major version from the current version string.
func NextMinorVersion ¶
NextMinorVersion returns the next minor version from the current version string.
func NextPatchVersion ¶
NextPatchVersion returns the next patch version from the current version string.
Types ¶
type GitHubReleaser ¶
type GitHubReleaser struct {
// contains filtered or unexported fields
}
GitHubReleaser implements Releaser for GitHub.
func NewGitHubReleaser ¶
func NewGitHubReleaser(token string) *GitHubReleaser
NewGitHubReleaser creates a new GitHub releaser.
func (*GitHubReleaser) CreateRelease ¶
func (r *GitHubReleaser) CreateRelease(ctx context.Context, req *model.ReleaseRequest) (*model.Release, error)
CreateRelease creates a new release for a repository.
func (*GitHubReleaser) CreateTag ¶
func (r *GitHubReleaser) CreateTag(ctx context.Context, repo model.RepoRef, tagName, sha, message string) error
CreateTag creates a new tag for a repository.
func (*GitHubReleaser) GetDefaultBranchSHA ¶
func (r *GitHubReleaser) GetDefaultBranchSHA(ctx context.Context, repo model.RepoRef, branch string) (string, error)
GetDefaultBranchSHA returns the SHA of the default branch HEAD.
func (*GitHubReleaser) GetLatestTag ¶
GetLatestTag returns the most recent semver tag.
type Options ¶
type Options struct {
Prefix string // Version prefix, e.g., "v"
GenerateNotes bool // Use GitHub's auto-generated release notes
Draft bool // Create as draft
Prerelease bool // Mark as prerelease
IncludeBody bool // Include changelog in body
}
Options configures release behavior.
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns sensible default release options.
type Releaser ¶
type Releaser interface {
// CreateRelease creates a new release for a repository.
CreateRelease(ctx context.Context, req *model.ReleaseRequest) (*model.Release, error)
// CreateTag creates a new tag for a repository.
CreateTag(ctx context.Context, repo model.RepoRef, tagName, sha, message string) error
// GetLatestTag returns the most recent semver tag.
GetLatestTag(ctx context.Context, repo model.RepoRef) (string, error)
// GetTagSHA returns the SHA for a given tag.
GetTagSHA(ctx context.Context, repo model.RepoRef, tagName string) (string, error)
// GetDefaultBranchSHA returns the SHA of the default branch HEAD.
GetDefaultBranchSHA(ctx context.Context, repo model.RepoRef, branch string) (string, error)
}
Releaser defines the interface for creating releases.
type Version ¶
type Version struct {
Major int
Minor int
Patch int
Prerelease string
Build string
Prefix string // "v" or empty
}
Version represents a semantic version.