{"id":19557857,"url":"https://github.com/monax/relic","last_synced_at":"2025-07-02T09:34:39.370Z","repository":{"id":57482347,"uuid":"122637309","full_name":"monax/relic","owner":"monax","description":"Release, versioning, and changelog conventions for Go","archived":false,"fork":false,"pushed_at":"2019-09-23T14:08:52.000Z","size":437,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-24T16:02:20.562Z","etag":null,"topics":["golang","release-automation"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monax.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-23T15:18:24.000Z","updated_at":"2025-05-28T17:08:50.000Z","dependencies_parsed_at":"2022-09-02T04:21:18.773Z","dependency_job_id":null,"html_url":"https://github.com/monax/relic","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/monax/relic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monax%2Frelic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monax%2Frelic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monax%2Frelic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monax%2Frelic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monax","download_url":"https://codeload.github.com/monax/relic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monax%2Frelic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263111971,"owners_count":23415545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","release-automation"],"created_at":"2024-11-11T04:44:16.757Z","updated_at":"2025-07-02T09:34:39.326Z","avatar_url":"https://github.com/monax.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Relic\nRelic is a library to help with versioning your projects by storing release metadata \nand versions as code.\n\n## Purpose\nRelic allows you define your project version history in a declarative style by\ndefining a `History` object somewhere in your project whose methods allow you to\ndeclare releases defined by a version number and release note. It ensures your releases\nhave monotonically increasing unique versions. \n\nRelic can generate the current version and a complete [changelog](CHANGELOG.md) using this information.\n\nRelic can be used by CI systems to output version numbers for tagging artefacts and automatically pushing releases,\nsuch as [goreleaser](https://github.com/goreleaser/goreleaser).\n\nBy keeping the changelog with the version they are synchronised and you are reminded to produce \nthe changelog.\n\n![relic marmot](docs/images/relic.png)\n\n## Usage\n```go\n// Add file to your project in which to record your projects revision history\npackage project\n\nimport (\n\t\"fmt\"\n\t\"text/template\"\n\t\"github.com/monax/relic\"\n)\n\n// Create a global variable in which to store your project history.\n// MustDeclareReleases allows you to declare your releases by specifying a version and release note\n// for each release. To add a new release just insert it at the top.\nvar History relic.ImmutableHistory = relic.NewHistory(\"Relic\", \"https://github.com/monax/relic\").\n\tMustDeclareReleases(\n\t\t\"2.0.0 - 2018-08-15\",\n\t\t`### Changed\n- Versions must start from 0.0.1 (0.0.0 is reserved for unreleased)\n- Default changelog format follows https://keepachangelog.com/en/1.0.0/\n- NewHistory takes second parameter for project URL\n- Dropped getters from Version since already passed by value so immutable\n\n### Added\n- Optional top (most recent) release may be provided with empty Version with (via empty string in DeclareReleases) whereby its notes will be listed under 'Unreleased'\n- Optional date can be appended to version using the exact format \u003cmajor.minor.patch - YYYY-MM-DD\u003e e.g. '5.4.2 - 2018-08-14'\n- Default changelog format footnote references standard github compare links to see commits between version tags\n`,\n\t\t\"1.1.0\",\n\t\t`Add ImmutableHistory and tweak suggested usage docs`,\n\t\t\"1.0.1\",\n\t\t`Documentation fixes and typos`,\n\t\t\"1.0.0\",\n\t\t`Minor improvements:\n- Rename DeclareReleases to DeclareReleases (breaking API change)\n- Add sample snippet to readme\n- Sign version tags\n`,\n\t\t\"0.0.1\",\n\t\t`First release of Relic extracted from various initial projects, it can:\n- Generate changelogs\n- Print the current version\n- Ensure valid semantic version numbers\n`)\n\nfunc PrintReleaseInfo() {\n\t// Print the current version\n\tfmt.Printf(\"%s (Version: %v)\\n\", History.Project(), History.CurrentVersion().String())\n\t// Print the complete changelog \n\tfmt.Println(History.Changelog())\n\t// Get specific release\n\trelease, err := History.Release(\"0.0.1\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t// Print major version of release\n\tfmt.Printf(\"Release Major version: %v\", release.Version.Major)\n}\n\n// You can also define histories with a custom template\nvar ProjectWithTemplate = relic.NewHistory(\"Test Project\", \"https://github.com/test/project\").\n\t\tWithChangelogTemplate(template.Must(template.New(\"tests\").\n\t\t\tParse(\"{{range .Releases}}{{$.Name}} (v{{.Version}}): {{.Notes}}\\n{{end}}\"))).\n\t\tMustDeclareReleases(\n\t\t\t// Releases may optionally have a date which is included in the changelog\n\t\t\t\"0.1.0 - 2016-07-12\",\n\t\t\t\"Basic functionality\",\n\t\t\t\"0.0.2\",\n\t\t\t\"Build scripts\",\n\t\t\t\"0.0.1\",\n\t\t\t\"Proof of concept\",\n\t\t)\n\n```\n\nSee Relic's own [`project` package](project/releases.go) and [Makefile](Makefile) for suggested usage within a project.\n\n## Dependencies\nGo standard library and tooling plus Make and Bash for builds (but not required).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonax%2Frelic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonax%2Frelic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonax%2Frelic/lists"}