Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asset ¶ added in v0.2.0
type Asset struct {
ID int `json:"id"`
Name string `json:"name"`
Label string `json:"label"`
State string `json:"state"`
Size int `json:"size"`
ContentType string `json:"content_type"`
DownloadURL string `json:"browser_download_url"`
}
Asset is the model for release assets
type Changelog ¶
type Changelog interface {
Filename() string
Generate(ctx context.Context, repo, tag string) (string, error)
}
Changelog is the interface for change log generation
func NewChangelog ¶
NewChangelog creates a new instance of Changelog
type Git ¶
type Git interface {
IsClean() (bool, error)
GetRepo() (*Repo, error)
GetBranch() (*Branch, error)
GetHEAD() (*Commit, error)
Commit(message string, files ...string) error
Tag(tag string) error
Push(withTags bool) error
Pull() error
}
Git is the interface for a git client
type Github ¶
type Github interface {
BranchProtectionForAdmin(ctx context.Context, repo, branch string, enabled bool) error
CreateRelease(ctx context.Context, repo string, in ReleaseInput) (*Release, error)
EditRelease(ctx context.Context, repo string, releaseID int, in ReleaseInput) (*Release, error)
GetRelease(ctx context.Context, repo string, version SemVer) (*Release, error)
GetReleases(ctx context.Context, repo string) ([]Release, error)
GetLatestRelease(ctx context.Context, repo string) (*Release, error)
UploadAssets(ctx context.Context, release *Release, assets ...string) error
}
Github is the interface for API calls to GitHub
type Release ¶
type Release struct {
ID int `json:"id"`
Name string `json:"name"`
TagName string `json:"tag_name"`
Target string `json:"target_commitish"`
Draft bool `json:"draft"`
Prerelease bool `json:"prerelease"`
Body string `json:"body"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
AssetsURL string `json:"assets_url"`
UploadURL string `json:"upload_url"`
Assets []Asset `json:"assets"`
}
Release is the model for GitHub release
type ReleaseInput ¶ added in v0.1.9
type ReleaseInput struct {
Name string `json:"name"`
TagName string `json:"tag_name"`
Target string `json:"target_commitish"`
Draft bool `json:"draft"`
Prerelease bool `json:"prerelease"`
Body string `json:"body"`
}
ReleaseInput is the model for creating and editing a release
type SemVer ¶
SemVer represents a semantic versioning
func ParseSemVer ¶
ParseSemVer reads a semantic version string and returns a SemVer
func (SemVer) GitTag ¶
GitTag returns a string representation of semantic version to be used as a git tag
func (SemVer) PreRelease ¶
PreRelease returns a string representation of semantic version to be used as a prelease version
func (SemVer) ReleaseMajor ¶
ReleaseMajor returns the current and next semantic versions for a major release
func (SemVer) ReleaseMinor ¶
ReleaseMinor returns the current and next semantic versions for a minor release
func (SemVer) ReleasePatch ¶
ReleasePatch returns the current and next semantic versions for a patch release
type VersionManager ¶
VersionManager is the interface for a semantic versioning manager
func NewJSONVersionManager ¶
func NewJSONVersionManager(file string) VersionManager
NewJSONVersionManager creates a new version manager for a json version file (package.json)
func NewTextVersionManager ¶
func NewTextVersionManager(file string) VersionManager
NewTextVersionManager creates a new version manager for a text version file
func NewVersionManager ¶
func NewVersionManager(file string) (VersionManager, error)
NewVersionManager creates a new instance of version manager