0
0
Fork 0
mirror of https://codeberg.org/forgejo/docs.git synced 2024-11-25 18:19:26 -05:00
forgejo-docs/docs/user/semver.md

46 lines
1.8 KiB
Markdown
Raw Normal View History

2023-03-16 04:58:03 -04:00
---
title: Semantic version
license: 'CC-BY-SA-4.0'
---
[SemVer](https://semver.org/spec/v2.0.0.html) allows users to understand the scope of a software update at first glance, based on the following :
2023-03-16 11:12:51 -04:00
- Patch is increased for backwards-compatible bugfixes.
- Minor is increased for backwards-compatible new features.
- Major is increased for breaking changes.
2023-03-16 04:58:03 -04:00
_something_ could be :
2023-03-16 04:58:03 -04:00
- a command, an option or an argument, for a CLI ;
- a route path, a query parameter or a body property, for a REST API ;
- a text node, a button or a field, for a GUI.
Since Forgejo has all of the above, changes to all of those components should be taken into consideration when creating a new version number.
## Getting the Forgejo semantic version
2023-03-16 13:17:14 -04:00
As of Forgejo v1.19, there are two version numbering schemes:
2023-03-16 04:58:03 -04:00
- [Following the Gitea version](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/CONTRIBUTING/RELEASE.md#release-numbering) which is not a semantic version
- Used to name release files
- Used for tagging releases
- Displayed in the web interface
- Returned by the `/api/v1/version` API endpoint
- Forgejo semantic version
- Returned by the `/api/forgejo/v1/version` API endpoint
2023-03-16 04:58:03 -04:00
For instance, the semantic version for https://code.forgejo.org can be obtained with:
```shell
$ curl https://code.forgejo.org/api/forgejo/v1/version
{"version":"3.0.0+0-gitea-1.19.0"}
2023-03-16 04:58:03 -04:00
```
## Understanding the Forgejo semantic version
The structure of the version number is `<major>.<minor>.<patch>+<build>-gitea-<gitea version>` where:
- `<major>.<minor>.<patch>` is conformant to [Semantic Versioning 2.0.0](https://semver.org/#semantic-versioning-200)
- `<build>` is the release build number of an otherwise identical source
- `gitea-<gitea version>` is the Gitea version this Forgejo release depends on