mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
releaser: Make it a one click release for patch releases
This commit is contained in:
@@ -94,6 +94,7 @@ func (r *ReleaseHandler) Run() error {
|
||||
|
||||
version := newVersion.String()
|
||||
tag := "v" + version
|
||||
isPatch := newVersion.PatchLevel > 0
|
||||
|
||||
// Exit early if tag already exists
|
||||
exists, err := tagExists(tag)
|
||||
@@ -128,8 +129,8 @@ func (r *ReleaseHandler) Run() error {
|
||||
return err
|
||||
}
|
||||
|
||||
prepareRelaseNotes := relNotesState == releaseNotesNone
|
||||
shouldRelease := relNotesState == releaseNotesReady
|
||||
prepareRelaseNotes := isPatch || relNotesState == releaseNotesNone
|
||||
shouldRelease := isPatch || relNotesState == releaseNotesReady
|
||||
|
||||
defer r.gitPush() // TODO(bep)
|
||||
|
||||
@@ -152,7 +153,7 @@ func (r *ReleaseHandler) Run() error {
|
||||
}
|
||||
|
||||
if prepareRelaseNotes {
|
||||
releaseNotesFile, err := r.writeReleaseNotesToTemp(version, gitCommits, gitCommitsDocs)
|
||||
releaseNotesFile, err := r.writeReleaseNotesToTemp(version, isPatch, gitCommits, gitCommitsDocs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -160,7 +161,14 @@ func (r *ReleaseHandler) Run() error {
|
||||
if _, err := r.git("add", releaseNotesFile); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := r.git("commit", "-m", fmt.Sprintf("%s Add release notes draft for %s\n\nRename to *-ready.md to continue. [ci skip]", commitPrefix, newVersion)); err != nil {
|
||||
|
||||
commitMsg := fmt.Sprintf("%s Add release notes for %s", commitPrefix, newVersion)
|
||||
if !isPatch {
|
||||
commitMsg += "\n\nRename to *-ready.md to continue."
|
||||
}
|
||||
commitMsg += "\n[ci skip]"
|
||||
|
||||
if _, err := r.git("commit", "-m", commitMsg); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user