semrel

package
v1.22.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyChange

func ApplyChange(version *semver.Version, change Change, allowInitialDevelopmentVersions bool) *semver.Version

func GetChangelog

func GetChangelog(commits []*Commit, latestRelease *Release, newVersion *semver.Version) string

func GetNewVersion

func GetNewVersion(conf *config.Config, commits []*Commit, latestRelease *Release) *semver.Version

Types

type Change

type Change struct {
	Major, Minor, Patch bool
}

func CalculateChange added in v1.20.0

func CalculateChange(commits []*Commit, latestRelease *Release) Change

type Commit

type Commit struct {
	SHA     string
	Raw     []string
	Type    string
	Scope   string
	Message string
	Change  Change
}

type GitHubRepository added in v1.20.0

type GitHubRepository struct {
	Ctx    context.Context
	Client *github.Client
	// contains filtered or unexported fields
}

func NewGitHubRepository added in v1.20.0

func NewGitHubRepository(ctx context.Context, gheHost, slug, token string) (*GitHubRepository, error)

func (*GitHubRepository) CreateRelease added in v1.20.0

func (repo *GitHubRepository) CreateRelease(changelog string, newVersion *semver.Version, prerelease bool, branch, sha string) error

func (*GitHubRepository) GetCommits added in v1.20.0

func (repo *GitHubRepository) GetCommits(sha string) ([]*Commit, error)

func (*GitHubRepository) GetInfo added in v1.20.0

func (repo *GitHubRepository) GetInfo() (string, bool, error)

func (*GitHubRepository) GetLatestRelease added in v1.20.0

func (repo *GitHubRepository) GetLatestRelease(vrange string, re *regexp.Regexp) (*Release, error)

func (*GitHubRepository) Owner added in v1.20.0

func (repo *GitHubRepository) Owner() string

func (*GitHubRepository) Provider added in v1.20.0

func (repo *GitHubRepository) Provider() string

func (*GitHubRepository) Repo added in v1.20.0

func (repo *GitHubRepository) Repo() string

type GitLabRepository added in v1.20.0

type GitLabRepository struct {
	Ctx context.Context
	// contains filtered or unexported fields
}

func NewGitLabRepository added in v1.20.0

func NewGitLabRepository(ctx context.Context, gitlabBaseUrl, slug, token, branch string, projectID string) (*GitLabRepository, error)

func (*GitLabRepository) CreateRelease added in v1.20.0

func (repo *GitLabRepository) CreateRelease(changelog string, newVersion *semver.Version, prerelease bool, branch, sha string) error

func (*GitLabRepository) GetCommits added in v1.20.0

func (repo *GitLabRepository) GetCommits(sha string) ([]*Commit, error)

func (*GitLabRepository) GetInfo added in v1.20.0

func (repo *GitLabRepository) GetInfo() (string, bool, error)

func (*GitLabRepository) GetLatestRelease added in v1.20.0

func (repo *GitLabRepository) GetLatestRelease(vrange string, re *regexp.Regexp) (*Release, error)

func (*GitLabRepository) Owner added in v1.20.0

func (repo *GitLabRepository) Owner() string

func (*GitLabRepository) Provider added in v1.20.0

func (repo *GitLabRepository) Provider() string

func (*GitLabRepository) Repo added in v1.20.0

func (repo *GitLabRepository) Repo() string

type Release

type Release struct {
	SHA     string
	Version *semver.Version
}

type Releases

type Releases []*Release

func (Releases) GetLatestRelease added in v1.19.0

func (releases Releases) GetLatestRelease(vrange string) (*Release, error)

func (Releases) Len

func (r Releases) Len() int

func (Releases) Less

func (r Releases) Less(i, j int) bool

func (Releases) Swap

func (r Releases) Swap(i, j int)

type Repository

type Repository interface {
	GetInfo() (string, bool, error)
	GetCommits(sha string) ([]*Commit, error)
	GetLatestRelease(vrange string, re *regexp.Regexp) (*Release, error)
	CreateRelease(changelog string, newVersion *semver.Version, prerelease bool, branch, sha string) error
	Owner() string
	Repo() string
	Provider() string
}

Jump to

Keyboard shortcuts

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