Releases: mszostok/version
v1.2.0
🎉 Version 1.2.0 is now available!
✨ Key highlights
In this release, thanks to @Kamsiy we enabled dynamic styling without the need to rebuild the CLI binary. Both YAML and JSON files are supported. Configure options:
- Enable loading style from environment variable via
version.WithPrettyStyleFromEnv("ENV_NAME_FOR_FILE_PATH")
, - Load a style file directly using Go function,
version.WithPrettyStyleFile("file_path")
.
Read more at:
- https://version.szostok.io/customization/pretty/layout/#config-file
- https://version.szostok.io/customization/pretty/format/#config-file
What's Changed
Enhancements 🚀
- Add example with global upgrade notice for cobra CLI by @mszostok in #61
- Add option to load config from file by @Kamsiy in #92
- Update docs, port bash script to Go, add example by @mszostok in #104
Other Changes ✨
- Update homepage with fixed typo by @mszostok in #59
- Update dependencies by @mszostok in #63
- Update dependencies by @mszostok in #82
- update test files by @Kamsiy in #95
- Bump all dependencies reported by Dependabot by @mszostok in #96
- Bump all dependencies, add target to refresh all go mods by @mszostok in #103
New Contributors
Full Changelog: v1.1.0...v1.2.0
v1.1.0
🎉 Version 1.1.0 is now available!
✨ Key highlights
Extra fields support!
Each project may want to display more information such as documentation or changelog URLs, sometimes even domain related fields.
Now you can provide them using your Go struct! You can also use a brand-new pretty
tag to define the field name for Pretty output.
type Custom struct {
// In the pretty mode, fields are printed in the same order as defined in struct.
BuiltBy string `json:"builtBy" yaml:"builtBy" pretty:"Built By"`
RepoURL string `json:"repoURL" yaml:"repoURL" pretty:"Repository URL"`
DocsURL string `json:"docsURL" yaml:"docsURL" pretty:"Documentation URL"`
}
func main() {
custom := Custom{
RepoURL: "https://github.com/mszostok/version",
DocsURL: "https://szostok.io/projects/version",
BuiltBy: "GoReleaser",
}
info := version.Get()
info.ExtraFields = custom
// ...
Learn more at version.szostok.io/customization/extra-fields.
Upgrade notice simplifications
Fetching the release information was changed from GET https://api.github.com/repos/{owner}/{repo}/releases/latest
to HEAD https://github.com/{owner}/{repo}/releases/latest
.
As a result, such call cannot hit rate limits set by GitHub for unauthorized calls. Additionally, I don't create the state file as it's not needed, and the call can be always executed. However, you can still enable caching via upgrade.WithMinElapseTimeForRecheck
.
Deprecation
The LookForLatestRelease
method is deprecated, will be removed in 1.4.0 release. It's only about naming, see:
Old: LookForLatestRelease(upgrade.LookForLatestReleaseInput{CurrentVersion: currentVersion})
New: LookForGreaterRelease(upgrade.LookForGreaterReleaseInput{CurrentVersion: currentVersion})
Install
To add the version
package, run:
go get go.szostok.io/version@v1.1.0
Next visit version.szostok.io/quick-start for the most popular way of the setup.
Changelog
Enhancements 🚀
- Add option to provide extra fields in Info object by @mszostok in #28
- Change the GitHub release fetcher by @mszostok in #33
- Add
isSmartTerminal
to post render hook by @mszostok in #35 - Add
isSmartTerminal
to upgrade render funcs by @mszostok in #36 - Serve cached upgrade notice, fix config dir by @mszostok in #50
- Refactor GitHub upgrade detector by @mszostok in #52
- Add cobra hooks, document options by @mszostok in #53
- Add docs for extra fields by @mszostok in #29
Fixed Bugs 🐛
Other Changes ✨
Test coverage related activities
- Introduce e2e tests and test all examples in colors and without colors by @mszostok in #37
- Test recheck interval, update README by @mszostok in #42
- Add full unit test coverage for printer package by @mszostok in #44
- Add unit test for cobra package by @mszostok in #45
- Add .exe suffix when running on Windows by @mszostok in #38
- Add coverall CI pipeline by @mszostok in #54
Full Changelog: v1.0.0...v1.1.0
v1.1.0-rc.1
This is a release candidate for 1.1.0. Use it only for testing purposes, if you find any bugs, file an issue.
v1.0.0
🎉 Version 1.0.0 is now available! Visit version.szostok.io for complete documentation about setup and usage.
Install
To add the version
package, run:
go get go.szostok.io/version@v1.0.0
Next visit version.szostok.io/quick-start for the most popular way of the setup.