{"id":20414492,"url":"https://github.com/thaffenden/vrsn","last_synced_at":"2025-03-05T03:28:11.632Z","repository":{"id":177572359,"uuid":"547763247","full_name":"thaffenden/vrsn","owner":"thaffenden","description":"A single tool for all of your semantic versioning needs.","archived":false,"fork":false,"pushed_at":"2023-05-22T02:01:37.000Z","size":90,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-15T13:32:54.859Z","etag":null,"topics":["check","circleci","cli","go","golang","semantic-versioning","semver","version","version-check","version-checker","version-manager","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/thaffenden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2022-10-08T08:41:04.000Z","updated_at":"2022-11-01T18:08:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"a652e50a-15ac-4de7-9c50-534185650b6e","html_url":"https://github.com/thaffenden/vrsn","commit_stats":null,"previous_names":["thaffenden/vrsn"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaffenden%2Fvrsn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaffenden%2Fvrsn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaffenden%2Fvrsn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaffenden%2Fvrsn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thaffenden","download_url":"https://codeload.github.com/thaffenden/vrsn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241959065,"owners_count":20049164,"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":["check","circleci","cli","go","golang","semantic-versioning","semver","version","version-check","version-checker","version-manager","versioning"],"created_at":"2024-11-15T06:10:20.577Z","updated_at":"2025-03-05T03:28:11.612Z","avatar_url":"https://github.com/thaffenden.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003evrsn\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eA single tool for \u003cstrong\u003eall\u003c/strong\u003e of your semantic versioning needs.\u003c/em\u003e\n\u003c/p\u003e\n\n![vrsn-demo](https://user-images.githubusercontent.com/14163530/204849040-39c8d4e2-80ef-4722-a04a-14a575ea4638.gif)\n\n## Contents\n\n- [Why](#why)\n- [Install](#install)\n  - [Download from GitHub](#download-from-github)\n  - [Build it locally](#build-it-locally)\n  - [Run the Docker container](#run-the-docker-container)\n  - [Use the CircleCI orb](#use-the-circleci-orb)\n- [Commands](#commands)\n- [Running in Docker](#running-in-docker)\n\n## Why?\n\n### Language agnostic\n\nYou can run `vrsn` in a project in any (supported) language and it will work.\n\nCurrently supported version files:\n\n| File | Languages |\n| --- | --- |\n| `build.gradle`, `build.gradle.kts` | ![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge\u0026logo=java\u0026logoColor=white) ![Kotlin](https://img.shields.io/badge/kotlin-%237F52FF.svg?style=for-the-badge\u0026logo=kotlin\u0026logoColor=white) |\n| `Cargo.toml` | ![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge\u0026logo=rust\u0026logoColor=white) |\n| `CMakeLists.txt` | ![C++](https://img.shields.io/badge/c++-%2300599C.svg?style=for-the-badge\u0026logo=c%2B%2B\u0026logoColor=white) |\n| `package.json` | ![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge\u0026logo=typescript\u0026logoColor=white) ![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge\u0026logo=javascript\u0026logoColor=%23F7DF1E) |\n| `pyproject.toml` | ![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54) |\n| `setup.py` | ![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54) |\n| `VERSION` | ![Go](https://img.shields.io/badge/go-%2300ADD8.svg?style=for-the-badge\u0026logo=go\u0026logoColor=white) + more |\n\nDon't see your favourite version file type in that list?\nSee the [CONTRIBUTING guide](./.github/CONTRIBUTING.md) for how to (easily) add\nsupport!\n\nIf you're the type of person that jumps between projects in different languages\nyou don't need to remember the `yarn` or `poetry` commands for each different\nproject, just use `vrsn` and get on with the important stuff.\n\n### Simple CI checks\n\nEnsuring you properly version releases is important.\n\nI've had to write semantic version checks in CI pipelines in different ways for\ndifferent languages in different jobs. Now I can just use `vrsn` and not have\nto worry about solving the same problems again.\n\n## Install\n\n### Download from GitHub\n\nFind the latest version for your system on the\n[GitHub releases page](https://github.com/thaffenden/vrsn/releases).\n\n### Build it locally\n\nIf you have go installed, you can clone this repo and run:\n\n```bash\nmake install\n```\n\nThis will build the binary and then copy it to `/usr/bin/vrsn` so it will be\navailable on your path. Nothing more to it.\n\n### Run the Docker container\n\nGet the Docker container from the\n[GitHub container registry](https://github.com/thaffenden/vrsn/pkgs/container/vrsn).\n\n```bash\ndocker pull ghcr.io/thaffenden/vrsn:latest\n```\n\nSee [Running in Docker](#running-in-docker) for more details.\n\n### Use the CircleCI Orb\n\nFor ease of running checks in your CI this repo includes a CircleCI orb.\nJust import the orb:\n\n```yaml\norbs:\n  vrsn: thaffenden/vrsn@volatile\n```\n\nThen use the `check-version` job in your workflow like:\n\n```yaml\nworkflows:\n  build:\n    jobs:\n      - vrsn/check-version:\n            filters:\n              branches:\n                ignore:\n                  - main\n```\n\nFor an example you can look at this repo's [CircleCI config](./.circleci/config.yml)\nwhich uses the orb.\n\nSee the [CircleCI orb docs](https://circleci.com/developer/orbs/orb/thaffenden/vrsn)\nfor more specifics on how to customise the orb jobs to best suite your needs.\n\nThe orb is semantically versioned using the same number as the `vrsn` binary\nand Docker container, so you can pin a specific version in your CI config or\nuse the `volatile` tag to always get the latest version of `vrsn`.\n\n## Commands\n\n### `--help`\n\nRun `vrsn --help` for a full up to date usage guide to get started or\n`vrsn [command] --help` if you want help with a specific command.\n\n### `check`\n\nRun `vrsn check` to automatically check versions on an existing git branch.\n\nBy default the `check` command can tell if you are on a branch that is not\nthe base branch (i.e. `main`) and will compare the version file on your current\nbranch with the version file on the base branch.\n\nThis command is super useful for running in CI, just run `vrsn check`, in your\npull request CI and `vrsn` will tell you if the version has been properly\nbumped or not.\n\nName your base branch something other than `main`?\nYou can use the `--base-branch` flag to specify the name you use.\n\nWant to run it from somewhere other than the root of your git repo? You can\nuse the `--was` and `--now` flags to pass in values from wherever you need to\ngrab them:\n\n```bash\nvrsn check --was $(\u003cfunction to get previous value\u003e) --now $(\u003cfunction to get current value\u003e)\n```\n\nYou can use the `--file` flag to point at a file that is not in the root of the\ngit repo (like in a monorepo with independantly versioned services), e.g.:\n\n```bash\nvrsn check --file './services/service-name/VERSION'\n```\n\n### `bump`\n\nRun `vrsn bump` to increment the current version file.\nIt will prompt you to select the bump type and then write the new valid semver\nversion in your version file.\n\nIf you want to avoid the interactive picker you can pass the increment level as\nan argument to the `bump` command, e.g.:\n\n```bash\nvrsn bump patch\n```\n\nWant to automatically commit the version bump? Just use the `--commit` flag. 🙌\n\nDon't like the default commit message? Provide your own custom one with\n`--commit-msg`.\n\nYou can use the `--file` flag to point at a file that is not in the root of the\ngit repo (like in a monorepo with independantly versioned services), e.g.:\n\n```bash\nvrsn bump --file './services/service-name/VERSION'\n```\n\nThis approach allows you to easily increment multiple versions in bulk, just\nwrite a script to iterate over each service that needs bumping and use the\ncommand `vrsn bump patch --file ./services/$SERIVCE_NAME/VERSION`.\n\n## Running in Docker\n\nTo run `vrsn` in a docker container you just need to mount the repo as a\nvolume, and `vrsn` can do it's thing, **however** git's\n[safe.directory](https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory)\nsettings would prevent `vrsn` from being able to use it's git based smarts 🧠.\n\nTo deal with this a directory called `/repo` is set as a safe directory as part\nof the Docker build process, and is configured as the container's working\ndirectory so it's recommended you use that as the destination of the volume\nmount. e.g.:\n\n```bash\ndocker run --rm -it -v $PWD:/repo vrsn:latest check\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthaffenden%2Fvrsn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthaffenden%2Fvrsn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthaffenden%2Fvrsn/lists"}