Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(readme): Add section about release naming conventions #563

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 61 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,66 @@ Options:
-h, --help Show help [boolean]
```


### Version naming conventions

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:

```txt
<major>.<minor>.<patch>(-<prerelease>)?(-<build>)?
```

- The `<major>`, `<minor>` and `<patch>` numbers are required
- The `<prerelease>` and `<build>` identifiers are optional

#### Preview releases (`<prerelease>`)

Preview or pre-release identifiers **must** include one of the following identifiers

```txt
preview|pre|rc|dev|alpha|beta|unstable|a|b
```

and may additionally include incremental pre-release version numbers.
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.

Examples:

```txt
1.0.0-preview
1.0.0-alpha.0
1.0.0-beta.1
1.0.0-rc.20
1.0.0-a

// invalid or incorrectly treated
1.0.0-foo
1.0.0-canary.0
```

#### Special Case: Python Post Releases


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`.
Given that we only consider certain identifiers as [pre-releases](#preview-releases-prerelease), post releases are considered stable releases.

### Build identifiers (`<build>`)

Craft supports adding a build identifier to your version, for example if you release the same package version for different platforms or architectures.
You can also combine build and pre-release identifiers but in this case, the pre-release identifier has to come first.

Examples:

```txt
// valid
1.0.0+x86_64
1.0.0-rc.1+x86_64

// invalid or incorrectly treated
1.0.0+rc.1+x86_64
1.0.0+x86_64-beta.0
```

## Caveats

- When interacting with remote GitHub repositories, `craft` uses the
Expand Down Expand Up @@ -519,8 +579,7 @@ changelog. Otherwise, defaults to the tag name and tag's commit message.

If `previewReleases` is set to `true` (which is the default), the release
created on GitHub will be marked as a pre-release version if the release name
contains any one of `preview`, `pre`, `rc`, `dev`,`alpha`, `beta`, `unstable`,
`a`, or `b`.
contains any one of [pre-release identifiers](#preview-releases-prerelease).

**Environment**

Expand Down
Loading