plugin

package
v0.0.0-...-634f7e0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseURL = "https://api.github.com/repos/%s/releases"

Functions

func New

func New(settings Settings, pipeline drone.Pipeline, network drone.Network) drone.Plugin

New initializes a plugin from the given Settings, Pipeline, and Network.

func RemoveBrackets

func RemoveBrackets(input string) string

func ReplaceToBytes

func ReplaceToBytes(s, old, new string, n int) []byte

func Version

func Version(input string) semver.Version

Types

type Asset

type Asset struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
	URL  string `json:"browser_download_url"`
}

type Plugin

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

Plugin implements drone.Plugin to provide the plugin implementation.

func (*Plugin) Execute

func (p *Plugin) Execute() error

Execute provides the implementation of the plugin.

func (*Plugin) Validate

func (p *Plugin) Validate() error

Validate handles the settings validation of the plugin.

type Release

type Release struct {
	Id          int       `json:"id"`
	Name        string    `json:"name"`
	TagName     string    `json:"tag_name"`
	Draft       bool      `json:"draft"`
	Prerelease  bool      `json:"prerelease"`
	PublishedAt time.Time `json:"published_at"`
	Assets      []Asset   `json:"assets"`
}

func FetchAllReleases

func FetchAllReleases(url string) ([]Release, error)

FetchAllReleases will return all releases. The latest release will be at position 0.

func FetchAllStableReleases

func FetchAllStableReleases(url string) ([]Release, error)

FetchAllStableReleases will return all stable releases. The latest release will be at position 0.

func FetchLatestRelease

func FetchLatestRelease(url string) (Release, error)

FetchLatestRelease will simply return the latested release, possibly a pre release.

func FetchLatestStableRelease

func FetchLatestStableRelease(url string) (Release, error)

FetchLatestStableRelease will return the latest stable release. This will exclude any releases marked as draft, prerelease or containing a pre-release marker in the name

func (Release) Print

func (r Release) Print()

func (Release) ReleaseToVersion

func (r Release) ReleaseToVersion() semver.Version

func (Release) Version

func (r Release) Version() semver.Version

type Releases

type Releases []Release

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 Settings

type Settings struct {
	GitHubURL  string
	Version    string
	Pipe       string
	PreRelease bool
	Mode       int
	// contains filtered or unexported fields
}

Settings for the plugin.

Jump to

Keyboard shortcuts

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