Skip to content

Commit be6f23e

Browse files
authored
doc(readme): Add section about release naming conventions (#563)
1 parent 2fa5479 commit be6f23e

File tree

1 file changed

+61
-2
lines changed

1 file changed

+61
-2
lines changed

README.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,66 @@ Options:
112112
-h, --help Show help [boolean]
113113
```
114114
115+
116+
### Version naming conventions
117+
118+
Craft currently supports [semantic versioning (semver)](https://semver.org)-like versions for the `NEW-VERSION` argument passed to its `prepare` and `publish` commands. This means, releases made with craft need to follow a general pattern as follows:
119+
120+
```txt
121+
<major>.<minor>.<patch>(-<prerelease>)?(-<build>)?
122+
```
123+
124+
- The `<major>`, `<minor>` and `<patch>` numbers are required
125+
- The `<prerelease>` and `<build>` identifiers are optional
126+
127+
#### Preview releases (`<prerelease>`)
128+
129+
Preview or pre-release identifiers **must** include one of the following identifiers
130+
131+
```txt
132+
preview|pre|rc|dev|alpha|beta|unstable|a|b
133+
```
134+
135+
and may additionally include incremental pre-release version numbers.
136+
Adding identifiers other than the ones listed above result in Craft either rejecting the release (if not parse-able) or the release being treated by individual targets as a stable release.
137+
138+
Examples:
139+
140+
```txt
141+
1.0.0-preview
142+
1.0.0-alpha.0
143+
1.0.0-beta.1
144+
1.0.0-rc.20
145+
1.0.0-a
146+
147+
// invalid or incorrectly treated
148+
1.0.0-foo
149+
1.0.0-canary.0
150+
```
151+
152+
#### Special Case: Python Post Releases
153+
154+
155+
Python has the concept of post releases, which craft handles implicitly. A post release is indicated by a `-\d+` suffix to the semver version, for example: `1.0.0-1`.
156+
Given that we only consider certain identifiers as [pre-releases](#preview-releases-prerelease), post releases are considered stable releases.
157+
158+
### Build identifiers (`<build>`)
159+
160+
Craft supports adding a build identifier to your version, for example if you release the same package version for different platforms or architectures.
161+
You can also combine build and pre-release identifiers but in this case, the pre-release identifier has to come first.
162+
163+
Examples:
164+
165+
```txt
166+
// valid
167+
1.0.0+x86_64
168+
1.0.0-rc.1+x86_64
169+
170+
// invalid or incorrectly treated
171+
1.0.0+rc.1+x86_64
172+
1.0.0+x86_64-beta.0
173+
```
174+
115175
## Caveats
116176
117177
- When interacting with remote GitHub repositories, `craft` uses the
@@ -519,8 +579,7 @@ changelog. Otherwise, defaults to the tag name and tag's commit message.
519579
520580
If `previewReleases` is set to `true` (which is the default), the release
521581
created on GitHub will be marked as a pre-release version if the release name
522-
contains any one of `preview`, `pre`, `rc`, `dev`,`alpha`, `beta`, `unstable`,
523-
`a`, or `b`.
582+
contains any one of [pre-release identifiers](#preview-releases-prerelease).
524583
525584
**Environment**
526585

0 commit comments

Comments
 (0)