diff --git a/Makefile b/Makefile index c769387e..fbc4d335 100644 --- a/Makefile +++ b/Makefile @@ -180,7 +180,12 @@ update-version: @echo @echo 'File replacement done, commit with:' @echo - @echo 'git commit -m "Bumped version to ${VERSION}" Makefile addon/flamenco/__init__.py addon/flamenco/manager addon/flamenco/manager_README.md web/app/src/manager-api' + @echo git commit -m "Bumped version to ${VERSION}" Makefile \ + addon/flamenco/__init__.py \ + addon/flamenco/manager \ + addon/flamenco/manager_README.md \ + web/app/src/manager-api \ + web/project-website/data/flamenco.yaml @echo 'git tag -a -m "Tagged version ${VERSION}" v${VERSION}' version: diff --git a/cmd/update-version/main.go b/cmd/update-version/main.go index 42fbc818..e7494240 100644 --- a/cmd/update-version/main.go +++ b/cmd/update-version/main.go @@ -34,6 +34,7 @@ func main() { anyFileWasChanged = anyFileWasChanged || updateMakefile() } anyFileWasChanged = anyFileWasChanged || updateAddon() + anyFileWasChanged = anyFileWasChanged || updateWebsite() if !anyFileWasChanged { log.Warn().Msg("nothing changed") diff --git a/cmd/update-version/website.go b/cmd/update-version/website.go new file mode 100644 index 00000000..e308c9fb --- /dev/null +++ b/cmd/update-version/website.go @@ -0,0 +1,28 @@ +package main + +import ( + "fmt" + "strings" + + "github.com/rs/zerolog/log" +) + +const websiteFile = "web/project-website/data/flamenco.yaml" + +// updateWebsite changes the version number of the latest version in the project +// website. +// Returns whether the file actually changed. +func updateWebsite() bool { + replacer := func(line string) string { + if !strings.HasPrefix(line, "latestVersion: ") { + return line + } + return fmt.Sprintf("latestVersion: %s", cliArgs.newVersion) + } + + fileWasChanged, err := updateLines(websiteFile, replacer) + if err != nil { + log.Fatal().Err(err).Msg("error updating project website") + } + return fileWasChanged +} diff --git a/web/project-website/content/development/releasing/_index.md b/web/project-website/content/development/releasing/_index.md index 8e99f7a2..2970e6b0 100644 --- a/web/project-website/content/development/releasing/_index.md +++ b/web/project-website/content/development/releasing/_index.md @@ -12,12 +12,8 @@ people. 1. Update `Makefile` and change the `VERSION` and `RELEASE_CYCLE` variables. 2. Run `make update-version` -3. Update the version for the website in - `web/project-website/data/flamenco.yaml`. This is currently a separate step, - as it influences the project website and not the built software. This could - be included in the `update-version` make target at some point. -4. Commit & tag with the commands shown in the 2nd step. -5. Run `make release-package` -6. Check that the files in `dist/` are there and have a non-zero size. -7. Run `make publish-release-packages` to upload the packages to the website. -8. Run `make project-website` to generate and publish the new website. +3. Commit & tag with the commands shown in the 2nd step. +4. Run `make release-package` +5. Check that the files in `dist/` are there and have a non-zero size. +6. Run `make publish-release-packages` to upload the packages to the website. +7. Run `make project-website` to generate and publish the new website.