Skip to content

Releases: mszostok/version

v1.2.0

06 May 14:42
a69cf43
Compare
Choose a tag to compare

🎉 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:

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 ✨

New Contributors

Full Changelog: v1.1.0...v1.2.0

v1.1.0

01 Oct 16:03
f21cf44
Compare
Choose a tag to compare

🎉 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 🚀

Fixed Bugs 🐛

  • Fix setting CLI name via ldflags, fix CLI name for cobra examples by @mszostok in #40

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

01 Oct 15:54
f21cf44
Compare
Choose a tag to compare
v1.1.0-rc.1 Pre-release
Pre-release

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

04 Sep 19:44
75daa2c
Compare
Choose a tag to compare

🎉 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.