Documentation
¶
Index ¶
- func AmendCommit(ctx context.Context, path string) error
- func CommitAndRelease(ctx context.Context, bump VersionBump, title string) error
- func CommitCompletedFile(ctx context.Context, path string) error
- func GetNextVersion(ctx context.Context, bump VersionBump) (string, error)
- func MoveFile(ctx context.Context, oldPath string, newPath string) error
- type Brancher
- type PRCreator
- type PRMerger
- type Releaser
- type SemanticVersionNumber
- type VersionBump
- type Worktree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AmendCommit ¶ added in v0.16.0
AmendCommit stages a file and amends the previous commit.
func CommitAndRelease ¶
func CommitAndRelease(ctx context.Context, bump VersionBump, title string) error
CommitAndRelease performs the full git workflow: 1. git add -A 2. Read CHANGELOG.md and rename ## Unreleased to version 3. Bump version (patch or minor) 4. git commit 5. git tag 6. git push + push tag
func CommitCompletedFile ¶ added in v0.2.27
CommitCompletedFile stages and commits a completed prompt file. This is called after MoveToCompleted() to ensure the moved file is committed. Does nothing if the file is already staged or committed.
func GetNextVersion ¶ added in v0.2.0
func GetNextVersion(ctx context.Context, bump VersionBump) (string, error)
GetNextVersion determines the next version based on the bump type.
Types ¶
type Brancher ¶ added in v0.9.0
type Brancher interface {
CreateAndSwitch(ctx context.Context, name string) error
Push(ctx context.Context, name string) error
ForcePush(ctx context.Context, name string) error
Switch(ctx context.Context, name string) error
CurrentBranch(ctx context.Context) (string, error)
Fetch(ctx context.Context) error
FetchAndVerifyBranch(ctx context.Context, branch string) error
DefaultBranch(ctx context.Context) (string, error)
Pull(ctx context.Context) error
MergeOriginDefault(ctx context.Context) error
}
Brancher handles git branch operations.
type PRCreator ¶ added in v0.9.0
PRCreator handles GitHub pull request creation.
func NewPRCreator ¶ added in v0.9.0
NewPRCreator creates a new PRCreator.
type PRMerger ¶ added in v0.17.6
PRMerger watches a PR until mergeable and merges it.
func NewPRMerger ¶ added in v0.17.6
NewPRMerger creates a new PRMerger.
type Releaser ¶ added in v0.2.26
type Releaser interface {
GetNextVersion(ctx context.Context, bump VersionBump) (string, error)
CommitAndRelease(ctx context.Context, bump VersionBump, title string) error
CommitCompletedFile(ctx context.Context, path string) error
CommitOnly(ctx context.Context, message string) error
AmendCommit(ctx context.Context, path string) error
HasChangelog(ctx context.Context) bool
MoveFile(ctx context.Context, oldPath string, newPath string) error
}
Releaser handles git commit, tag, and push operations.
type SemanticVersionNumber ¶ added in v0.2.33
SemanticVersionNumber represents a parsed semantic version.
func ParseSemanticVersionNumber ¶ added in v0.2.33
func ParseSemanticVersionNumber(ctx context.Context, tag string) (SemanticVersionNumber, error)
ParseSemanticVersionNumber parses "vX.Y.Z" into a SemanticVersionNumber. Returns error if format is invalid.
func (SemanticVersionNumber) BumpMinor ¶ added in v0.2.33
func (v SemanticVersionNumber) BumpMinor() SemanticVersionNumber
BumpMinor returns a new version with minor incremented and patch reset to 0.
func (SemanticVersionNumber) BumpPatch ¶ added in v0.2.33
func (v SemanticVersionNumber) BumpPatch() SemanticVersionNumber
BumpPatch returns a new version with patch incremented.
func (SemanticVersionNumber) Less ¶ added in v0.2.33
func (v SemanticVersionNumber) Less(other SemanticVersionNumber) bool
Less returns true if v is lower than other.
func (SemanticVersionNumber) String ¶ added in v0.2.33
func (v SemanticVersionNumber) String() string
String returns the "vX.Y.Z" representation.
type VersionBump ¶ added in v0.2.30
type VersionBump int
VersionBump specifies the type of version bump to perform.
const ( // PatchBump increments the patch version (vX.Y.Z -> vX.Y.Z+1) PatchBump VersionBump = iota // MinorBump increments the minor version (vX.Y.Z -> vX.Y+1.0) MinorBump )