release

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GoEmailConfig = Config{
	Changelog: "Changes.md",
	Owner:     "zostay",
	Project:   "go-email",

	TargetBranch: "master",
}

Functions

func IsDirty

func IsDirty(status git.Status) bool

IsDirty returns true if we consider the tree dirty. We do not consider Untracked to dirty the directory and we also ignore some filenames that are in the global .gitignore and not in the local .gitignore.

Types

type Config

type Config struct {
	// Version is the semantic version of the release being processed.
	Version *semver.Version

	// Branch is the name of the release branch.
	Branch string

	// Tag is the name of the final release tag.
	Tag string

	// Today is the date YYYY-MM-DD date of the release.
	Today string

	// Changelog is the name of the file holding the change log.
	Changelog string

	// Owner is the name of the owner of the project on github.
	Owner string

	// Project is the name of the repository on github.
	Project string

	// TargetBranch is the branch we are merging into (usually master).
	TargetBranch string

	// ChangesInfo is the bullets in the change log to put into the release
	// body.
	ChangesInfo string
}

func (*Config) BranchRef

func (c *Config) BranchRef() string

func (*Config) BranchRefName

func (c *Config) BranchRefName() plumbing.ReferenceName

func (*Config) BranchRefSpec

func (c *Config) BranchRefSpec() config.RefSpec

func (*Config) TagRef

func (c *Config) TagRef() string

func (*Config) TagRefSpec

func (c *Config) TagRefSpec() config.RefSpec

func (*Config) TargetBranchRef

func (c *Config) TargetBranchRef() string

func (*Config) TargetBranchRefName

func (c *Config) TargetBranchRefName() plumbing.ReferenceName

type Process

type Process struct {
	Config
	// contains filtered or unexported fields
}

func NewProcess

func NewProcess(ctx context.Context, v string, cfg *Config) (*Process, error)

func NewProcessContinuation

func NewProcessContinuation(ctx context.Context, cfg *Config) (*Process, error)

func (*Process) AddAndCommit

func (p *Process) AddAndCommit()

AddAndCommit adds changes made as part of the release process to the release branch.

func (*Process) CaptureChangesInfo

func (p *Process) CaptureChangesInfo()

CaptureChangesInfo loads the bullets for the changelog section relevant to this release into the process configuration for use when creating the release later.

func (*Process) CheckGitCleanliness

func (p *Process) CheckGitCleanliness()

CheckGitCleanliness ensures that the current git repository is clean and that we are on the correct branch from which to trigger a release.

func (*Process) CheckReadyForMerge

func (p *Process) CheckReadyForMerge(ctx context.Context)

CheckReadyForMerge ensures that all the required tests are passing.

func (*Process) Choke

func (p *Process) Choke(msg string)

func (*Process) Chokef

func (p *Process) Chokef(f string, args ...interface{})

func (*Process) Cleanup

func (p *Process) Cleanup()

func (*Process) CreateGithubPullRequest

func (p *Process) CreateGithubPullRequest(ctx context.Context)

CreateGithubPullRequest creates the PR on github for monitoring the test results for release testing. This will also be used to merge the release branch when testing passes.

func (*Process) CreateRelease

func (p *Process) CreateRelease(ctx context.Context)

CreateRelease creates a release on github for the release.

func (*Process) FixupChangelog

func (p *Process) FixupChangelog()

FixupChangelog alters the changelog to prepare it for release.

func (*Process) ForCleanup

func (p *Process) ForCleanup(action func())

func (*Process) LintChangelog

func (p *Process) LintChangelog(mode changes.CheckMode)

LintChangelog performs a check to ensure the changelog is ready for release.

func (*Process) MakeReleaseBranch

func (p *Process) MakeReleaseBranch()

MakeReleaseBranch creates the branch that will be used to manage the release.

func (*Process) MergePullRequest

func (p *Process) MergePullRequest(ctx context.Context)

MergePullRequest merges the PR into master.

func (*Process) PushReleaseBranch

func (p *Process) PushReleaseBranch()

PushReleaseBranch pushes the release branch to github for release testing.

func (*Process) SetupGitRepo

func (p *Process) SetupGitRepo()

func (*Process) TagRelease

func (p *Process) TagRelease()

TagRelease creates and pushes a tag for the newly merged release on master.

func (*Process) ToAdd

func (p *Process) ToAdd(fn string)

Jump to

Keyboard shortcuts

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