releaser: Delay the version bumping
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 20 May 2017 08:11:23 +0000 (11:11 +0300)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 20 May 2017 08:11:23 +0000 (11:11 +0300)
So we can do the release notes in its own branch if needed.

releaser/releaser.go

index e7e7f479fa608254768808f34f1bba30800e48ce..088b52ec1ab69b04711e431f8f0ba8607de74c92 100644 (file)
@@ -119,14 +119,6 @@ func (r *ReleaseHandler) Run() error {
        }
 
        if r.shouldPrepare() {
-               if err := bumpVersions(newVersion); err != nil {
-                       return err
-               }
-
-               if _, err := git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\n[ci skip]", commitPrefix, newVersion)); err != nil {
-                       return err
-               }
-
                releaseNotesFile, err := writeReleaseNotesToDocsTemp(version, gitCommits)
                if err != nil {
                        return err
@@ -145,6 +137,14 @@ func (r *ReleaseHandler) Run() error {
                return nil
        }
 
+       if err := bumpVersions(newVersion); err != nil {
+               return err
+       }
+
+       if _, err := git("commit", "-a", "-m", fmt.Sprintf("%s Bump versions for release of %s\n\n[ci skip]", commitPrefix, newVersion)); err != nil {
+               return err
+       }
+
        releaseNotesFile := getRelaseNotesDocsTempFilename(version)
 
        // Write the release notes to the docs site as well.