version

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcNextVer

func CalcNextVer(list []Commit, fromVersion *semver.Version) (*semver.Version, map[string][]*Commit)

func GitPushFollowTags added in v1.5.0

func GitPushFollowTags(ctx context.Context) error

func GitTagVersion

func GitTagVersion(ctx context.Context, ver *semver.Version, skipCommit bool, skipTag bool, versionFile string) error

func GitUpAll

func GitUpAll(ctx context.Context) error

func IsCleanWorkingDir

func IsCleanWorkingDir() (bool, error)

func LastVersion

func LastVersion() (ver *semver.Version, tag string, err error)

func ReadOrTouchChangeLogFile

func ReadOrTouchChangeLogFile() (*os.File, error)

func Truncate

func Truncate(v interface{}) error

func UpdateChangeLog

func UpdateChangeLog(file interface {
	io.Reader
	io.Writer
}, nextVer *semver.Version, fromVersion *semver.Version, sections map[string][]*Commit) error

Types

type Commit

type Commit struct {
	Hash   string `yaml:"hash"`
	Author struct {
		Name       string    `yaml:"name,omitempty"`
		Email      string    `yaml:"email,omitempty"`
		AuthoredAt time.Time `yaml:"authoredAt,omitempty"`
	} `yaml:"author,omitempty"`
	Committer struct {
		Name        string    `yaml:"name,omitempty"`
		Email       string    `yaml:"email,omitempty"`
		CommittedAt time.Time `yaml:"committedAt,omitempty"`
	} `yaml:"committer,omitempty"`
	*CommitMsg `yaml:"msg,omitempty"`
}

func ListCommit

func ListCommit(from string) ([]Commit, error)

func ResolveVersionAndCommits

func ResolveVersionAndCommits() (*semver.Version, []Commit, error)

type CommitMsg

type CommitMsg conventionalcommit.CommitMsg

func (CommitMsg) MarshalText

func (v CommitMsg) MarshalText() ([]byte, error)

func (*CommitMsg) UnmarshalText

func (v *CommitMsg) UnmarshalText(data []byte) error

type VersionAction added in v1.5.0

type VersionAction struct {
	// contains filtered or unexported fields
}

func NewVersionAction added in v1.5.0

func NewVersionAction(ctx context.Context, opt VersionOpt) *VersionAction

func (*VersionAction) Do added in v1.5.0

func (a *VersionAction) Do() error

type VersionOpt

type VersionOpt struct {
	VersionFile string
	Prerelease  string
	PostVersion func(version string) error
	SkipPull    bool
	SkipCommit  bool
	SkipTag     bool
	SkipPush    bool
}

Jump to

Keyboard shortcuts

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