aboutsummaryrefslogtreecommitdiffhomepage
path: root/releaser/releaser.go
diff options
context:
space:
mode:
Diffstat (limited to 'releaser/releaser.go')
-rw-r--r--releaser/releaser.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/releaser/releaser.go b/releaser/releaser.go
index 2b7dbba5f..d32e511c6 100644
--- a/releaser/releaser.go
+++ b/releaser/releaser.go
@@ -31,12 +31,13 @@ import (
const commitPrefix = "releaser:"
+// ReleaseHandler provides functionality to release a new version of Hugo.
type ReleaseHandler struct {
cliVersion string
// If set, we do the releases in 3 steps:
- // 1: Create and write a draft release notes
- // 2: Prepare files for new version.
+ // 1: Create and write a draft release note
+ // 2: Prepare files for new version
// 3: Release
step int
skipPublish bool
@@ -80,6 +81,7 @@ func (r ReleaseHandler) calculateVersions() (helpers.HugoVersion, helpers.HugoVe
return newVersion, finalVersion
}
+// New initialises a ReleaseHandler.
func New(version string, step int, skipPublish, try bool) *ReleaseHandler {
rh := &ReleaseHandler{cliVersion: version, step: step, skipPublish: skipPublish, try: try}
@@ -95,6 +97,7 @@ func New(version string, step int, skipPublish, try bool) *ReleaseHandler {
return rh
}
+// Run creates a new release.
func (r *ReleaseHandler) Run() error {
if os.Getenv("GITHUB_TOKEN") == "" {
return errors.New("GITHUB_TOKEN not set, create one here with the repo scope selected: https://github.com/settings/tokens/new")