Add script to update changelogs

This commit is contained in:
John Bintz 2021-10-15 15:53:57 -04:00
parent e563870ced
commit 62ee0fec73
3 changed files with 33 additions and 0 deletions

View File

@ -1,3 +1,7 @@
## 0.88.1~2021-10-10
* Upgrade Hugo to 0.88.1 extended
## 0.79.1~2020-12-22 ## 0.79.1~2020-12-22
* Upgrade Hugo to 0.79.1 to deal with security issue * Upgrade Hugo to 0.79.1 to deal with security issue

View File

@ -41,6 +41,7 @@ store you would need either the original app key or
## Pack and publish ## Pack and publish
* Run `bin/update_changelogs` to update changelogs for the package
* Run `bin/pack_hugo` to create an spk in the parent directory to ths one * Run `bin/pack_hugo` to create an spk in the parent directory to ths one
* Try loading that spk into a separate Sandstorm instance for testing * Try loading that spk into a separate Sandstorm instance for testing
* If it works, run `bin/publish_hugo` to publish that version to the App Market * If it works, run `bin/publish_hugo` to publish that version to the App Market

28
bin/update_changelogs Normal file → Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env ruby
SANDSTORM_CHANGELOG = ".sandstorm/changelog.md"
CHANGELOG = "CHANGELOG.md"
SANDSTORM_VERSION_FILE = ".sandstorm/app-marketing-version"
HUGO_VERSION_FILE = "hugo-version"
HUGO_VERSION = File.read(HUGO_VERSION_FILE).chomp
[
[SANDSTORM_CHANGELOG, SANDSTORM_VERSION_FILE],
[CHANGELOG, HUGO_VERSION_FILE]
].each do |(changelog, version_file)|
data = File.readlines(changelog).map(&:chomp)
version = File.read(version_file).chomp
unless data.any? { |line| line[version] }
data = [
"## #{version}",
"",
"* Upgrade Hugo to #{HUGO_VERSION} extended",
""
].concat(data)
File.open(changelog, 'w') { |fh| fh.print data.join("\n") + "\n" }
end
end