{"id":22787392,"url":"https://github.com/aserto-dev/sver","last_synced_at":"2025-08-09T18:31:17.124Z","repository":{"id":39876934,"uuid":"329468803","full_name":"aserto-dev/sver","owner":"aserto-dev","description":"Calculates semantic versions in a git repo","archived":false,"fork":false,"pushed_at":"2023-11-22T13:29:56.000Z","size":346,"stargazers_count":15,"open_issues_count":10,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-19T02:59:16.029Z","etag":null,"topics":["go","semantic","semver","version","versioning"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aserto-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-14T00:47:15.000Z","updated_at":"2023-10-20T22:37:29.000Z","dependencies_parsed_at":"2023-11-22T14:35:51.340Z","dependency_job_id":"c08950c1-a66a-400d-95dc-8d79a981f7fa","html_url":"https://github.com/aserto-dev/sver","commit_stats":null,"previous_names":["aserto-dev/calc-version"],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aserto-dev%2Fsver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aserto-dev%2Fsver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aserto-dev%2Fsver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aserto-dev%2Fsver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aserto-dev","download_url":"https://codeload.github.com/aserto-dev/sver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229313609,"owners_count":18053714,"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":["go","semantic","semver","version","versioning"],"created_at":"2024-12-12T00:56:08.973Z","updated_at":"2024-12-12T00:56:09.442Z","avatar_url":"https://github.com/aserto-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!IMPORTANT]\n\u003e This repository is archived and no longer maintained.\n\n# sver\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/aserto-dev/sver.svg)](https://pkg.go.dev/github.com/aserto-dev/sver)\n[![Coverage Status](https://coveralls.io/repos/github/aserto-dev/sver/badge.svg?branch=main)](https://coveralls.io/github/aserto-dev/sver?branch=main)\n[![ci](https://github.com/aserto-dev/sver/actions/workflows/ci.yaml/badge.svg)](https://github.com/aserto-dev/sver/actions/workflows/ci.yaml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/aserto-dev/sver)](https://goreportcard.com/report/github.com/aserto-dev/sver)\n\nCalculates semantic versions in a git repo.\n\n`sver` requires the latest tag of the current branch to be a semantic version, otherwise it fails.\nSemantic versions with plus elements like `1.0.2+gold` are not supported and also fail.\n\nIf the latest tag in the current branch points to `HEAD`, no pre-release version information is added. \n\nOtherwise, `\u003ccommit_timestamp\u003e.\u003cbranch_commit_count\u003e.g\u003ccommit_short_hash\u003e` is appended to the version string.\n`\u003ccommit_timestamp\u003e` is in the format `yyyymmddHHMMSS`.\n\nIf there are uncommitted changes to the source tree, the `-dirty` string is appended to the final version string.\n\nFor example: `1.2.0-20201027184820.3186.g4fc2e9e5-dirty`\n\n## Calculating the next version\n\n`sver` can also calculate the next semantic version based on the current version. To do so, use the `--next` flag. Possible values are `major`, `minor` or `patch`.\n\n## Container image tags\n\nWhen using the `tags` sub-command, `sver` will look at existing tags in an image repository, and figure out which tags you should apply to the image you're building from the current git commit.\n\nFor example if you have tags `1.0.0`, `1.1.0` and `2.1.0` and your current tag is `2.1.0`, running `sver tags` will output:\n\n- `2.1.0` - your new version\n- `2.1` - because it’s the latest in the 2.1.* series\n- `2` - because it's the latest in the 2.* series\n- `latest` - because there’s no other version that’s higher\n\nIf you then work on top of tag `1.0.0`, and create a patch tagged `1.0.1`, running `sver tags` will output:\n\n- `1.0.1` - your new version\n- `1.0` - because it's the latest in the 1.0.* series\n\n\u003e It’s not outputting `latest` because `2.1.0` is higher than `1.0.1`, and it’s not outputting `1` because `1.1.0` is higher than `1.0.1`.\n\n## See also\n\nThe [sver github action](https://github.com/marketplace/actions/sver-semantic-version-calculator).\n\n### Similar projects\n\n- https://github.com/caarlos0/svu\n- https://github.com/mdomke/git-semver\n- https://github.com/semantic-release/semantic-release\n- https://goreleaser.com/\n\n## Credits\n\nBased on [this implementation](https://github.com/cloudfoundry-incubator/kubecf-tools/tree/main/versioning).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faserto-dev%2Fsver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faserto-dev%2Fsver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faserto-dev%2Fsver/lists"}