Merge pull request #12 from jimeh/optional-hard-coded-version

Make hard-coded version string and version bump commits optional
This commit is contained in:
2017-08-04 12:15:14 +01:00
committed by GitHub

View File

@@ -86,37 +86,51 @@ interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
others, the RECOMMENDED way to do so is by creating a pull request and others, the RECOMMENDED way to do so is by creating a pull request and
discuss the changes with others there. discuss the changes with others there.
5. Versioning 5. Versioning
1. The project MUST have its version hard-coded somewhere in the 1. A "version string" is a typically mostly numeric string that identifies a
code-base. It is RECOMMENDED that this is done in a file called "VERSION" specific version of a project. The version string itself MUST NOT have a
located in the root of the project. "v" prefix, but the version string can be displayed with a "v" prefix to
2. If you are using a "VERSION" file in the root of the project, this MUST indicate it a version that is being referred to.
only contain the exact version string. 2. The source of truth for project version MUST be a git tag with a name
3. The version string SHOULD follow the Semantic Versioning based on the version string. This kind of tag MUST be referred to as a
(<http://semver.org/>) format. Use of Semantic Versioning is OPTIONAL, "release tag".
but the version string MUST NOT have a "v" prefix. For example "v2.11.4" 3. It is OPTIONAL, but RECOMMENDED to also keep the version string
is bad, and "2.11.4" is good. hard-coded somewhere in the project code-base.
6. Releases 4. If you hard-code the version string into the code-base, it is RECOMMENDED
1. To create a new release, you MUST create a "version bump" commit which that you do so in a file called "VERSION" located in the root of the
changes the hard-coded version string of the project. The version bump project. But be mindful of the conventions of your programming language
commit MUST have a git tag created on it and named as the exact version and community when choosing if, where and how to hard-code the version
string. string.
2. If you are not using a release branch, then the version bump commit MUST 5. If you are using a "VERSION" file in the root of the project, this file
be created directly on the master branch. MUST only contain the exact version string, meaning it MUST NOT have a
3. The version bump commit MUST have a commit message title of "Bump version "v" prefix. For example "v2.11.4" is bad, and "2.11.4" is good.
to VERSION". For example, if the new version string is "2.11.4", the 6. It is OPTIONAL, but RECOMMENDED that that the version string follows
first line of the commit message MUST read: "Bump version to 2.11.4" Semantic Versioning (<http://semver.org/>).
4. The release tag on the version bump commit MUST be named exactly the same 6. Releases
as the version string. The tag name can OPTIONALLY be prefixed with 1. To create a new release, you MUST create a git tag named as the exact
"v". For example the tag name can be either "2.11.4" or "v2.11.4". You version string of the release. This kind of tag MUST be referred to as a
MUST NOT use a mix of "v" prefixed and non-prefixed tags. Pick one form "release tag".
and stick to it. 2. The release tag name can OPTIONALLY be prefixed with "v". For example the
5. It is RECOMMENDED that release tags are lightweight tags, but you can tag name can be either "2.11.4" or "v2.11.4". You MUST NOT use a mixture
of "v" prefixed and non-prefixed tags. Pick one form and stick to it.
3. If the version string is hard-coded into the code-base, you MUST create a
"version bump" commit which changes the hard-coded version string of the
project.
4. When using version bump commits, the release tag MUST be placed on the
version bump commit.
5. If you are not using a release branch, then the release tag, and if
relevant the version bump commit, MUST be created directly on the master
branch.
6. The version bump commit SHOULD have a commit message title of "Bump
version to VERSION". For example, if the new version string is "2.11.4",
the first line of the commit message SHOULD read: "Bump version to
2.11.4"
7. It is RECOMMENDED that release tags are lightweight tags, but you can
OPTIONALLY use annotated tags if you want to include changelog OPTIONALLY use annotated tags if you want to include changelog
information in the release tag itself. information in the release tag itself.
6. If you use annotated release tags, the first line of the annotation MUST 8. If you use annotated release tags, the first line of the annotation
read "Release VERSION". For example for version "2.11.4" the first line SHOULD read "Release VERSION". For example for version "2.11.4" the first
of the tag annotation would read "Release 2.11.4". The second line must line of the tag annotation SHOULD read "Release 2.11.4". The second line
be blank, and the changelog MUST start on the third line. MUST be blank, and the changelog MUST start on the third line.
7. Release Branches 7. Release Branches
1. Any branch that has a name starting with "release-" SHOULD be referred to 1. Any branch that has a name starting with "release-" SHOULD be referred to
as a "release branch". as a "release branch".