diff --git a/build/scripts/sdk-update-version/main.go b/build/scripts/sdk-update-version/main.go index cada3daebf..a9e9f93d3c 100644 --- a/build/scripts/sdk-update-version/main.go +++ b/build/scripts/sdk-update-version/main.go @@ -44,6 +44,7 @@ func main() { log.Printf("Version: %s", version) files := []string{ + "build/Makefile", "install/helm/agones/Chart.yaml", "install/yaml/install.yaml", "install/helm/agones/values.yaml", @@ -87,14 +88,18 @@ func UpdateFile(filename string, version string) error { content = re.ReplaceAllString(content, "${1}") } case "after": - if ext == ".json" { + if ext != ".json" { + re := regexp.MustCompile(regexp.QuoteMeta(version)) + newVersion := incrementVersionAfterRelease(version) + if filename == "build/Makefile" { + content = re.ReplaceAllString(content, newVersion) + } else { + content = re.ReplaceAllString(content, newVersion+"-dev") + } + } else { re := regexp.MustCompile(`"` + regexp.QuoteMeta(version) + `"`) newVersion := incrementVersionAfterRelease(version) + "-dev" content = re.ReplaceAllString(content, `"`+newVersion+`"`) - } else { - re := regexp.MustCompile(regexp.QuoteMeta(version)) - newVersion := incrementVersionAfterRelease(version) - content = re.ReplaceAllString(content, newVersion+"-dev") } default: log.Fatalf("Invalid release stage. Please specify 'before' or 'after'.") diff --git a/build/scripts/site-config-update-version/main.go b/build/scripts/site-config-update-version/main.go index 3cff9fe64e..d553f893f6 100644 --- a/build/scripts/site-config-update-version/main.go +++ b/build/scripts/site-config-update-version/main.go @@ -190,10 +190,18 @@ func writeLinesToFile(filePath string, lines []string) error { writer := bufio.NewWriter(file) // Write the lines to the file - for _, line := range lines { - _, err := writer.WriteString(line + "\n") - if err != nil { - return err + for i, line := range lines { + // Avoid adding a new line at the end of the file + if i < len(lines)-1 { + _, err := writer.WriteString(line + "\n") + if err != nil { + return err + } + } else { + _, err := writer.WriteString(line) + if err != nil { + return err + } } } diff --git a/docs/governance/templates/release_issue.md b/docs/governance/templates/release_issue.md index 314c08a673..90e8e54117 100644 --- a/docs/governance/templates/release_issue.md +++ b/docs/governance/templates/release_issue.md @@ -23,7 +23,6 @@ and copy it into a release issue. Fill in relevant values, found inside {} - [ ] Run `make shell` and run `gcloud config configurations activate agones-images`. - [ ] Review merged PRs in the current milestone to ensure that they have appropriate tags. -- [ ] Ensure the next stable releases in the Google Calendar have the correct version number. - [ ] `git checkout main && git pull --rebase upstream main` - [ ] Run `make pre-build-release` to ensure all example images exist on agones-images/examples repository and to deploy the {version}-1 service on GCP/App Engine/Services. - [ ] Run `make sdk-update-version release_stage=before version={version}` file. This command will update the version number in the sdks/install files to {version}. @@ -63,7 +62,6 @@ and copy it into a release issue. Fill in relevant values, found inside {} - [ ] Paste the announcement blog post to the #users Slack group. - [ ] Post to the [agonesdev](https://twitter.com/agonesdev) Twitter account. - [ ] Run `git checkout main`. -- [ ] Then increment the `base_version` in [`build/Makefile`][build-makefile] - [ ] Run `make sdk-update-version release_stage=after version={version}` file. This command will update the version number in the sdks/install files to {version}+1-dev. - [ ] Create PR with these changes, and merge them with approval - [ ] Close this issue. _Congratulations!_ - the release is now complete! :tada: :clap: :smile: :+1: