mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-01-13 21:21:03 +00:00
chore: working releasable commits
This commit is contained in:
parent
97c407f939
commit
74ea8fba17
11 changed files with 1416 additions and 0 deletions
60
forge.go
Normal file
60
forge.go
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
package rp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type Forge interface {
|
||||
RepoURL() string
|
||||
}
|
||||
|
||||
type ForgeOptions struct {
|
||||
Repository string
|
||||
}
|
||||
|
||||
var _ Forge = &GitHub{}
|
||||
var _ Forge = &GitLab{}
|
||||
|
||||
type GitHub struct {
|
||||
options ForgeOptions
|
||||
}
|
||||
|
||||
func (g *GitHub) RepoURL() string {
|
||||
return fmt.Sprintf("https://github.com/%s", g.options.Repository)
|
||||
}
|
||||
|
||||
func (g *GitHub) autodiscover() {
|
||||
// Read settings from GitHub Actions env vars
|
||||
}
|
||||
|
||||
func NewGitHub(options ForgeOptions) *GitHub {
|
||||
gh := &GitHub{
|
||||
options: options,
|
||||
}
|
||||
|
||||
gh.autodiscover()
|
||||
|
||||
return gh
|
||||
}
|
||||
|
||||
type GitLab struct {
|
||||
options ForgeOptions
|
||||
}
|
||||
|
||||
func (g *GitLab) autodiscover() {
|
||||
// Read settings from GitLab-CI env vars
|
||||
}
|
||||
|
||||
func NewGitLab(options ForgeOptions) *GitLab {
|
||||
gl := &GitLab{
|
||||
options: options,
|
||||
}
|
||||
|
||||
gl.autodiscover()
|
||||
|
||||
return gl
|
||||
}
|
||||
|
||||
func (g *GitLab) RepoURL() string {
|
||||
return fmt.Sprintf("https://gitlab.com/%s", g.options.Repository)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue