Skip to content

Commit 9836b2e

Browse files
authored
doc(develop): Add SDK release name convention documentation (#11787)
1 parent 0ee2911 commit 9836b2e

File tree

1 file changed

+61
-3
lines changed

1 file changed

+61
-3
lines changed

develop-docs/sdk/processes/releases.mdx

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ We're just interested in making a GitHub release and a PyPI release so our
4747
```yaml
4848
minVersion: 0.28.1
4949
targets:
50-
- name: pypi
51-
- name: github
50+
- name: pypi
51+
- name: github
5252
```
5353
5454
### `scripts/bump-version.sh`
@@ -147,6 +147,64 @@ add a label to.
147147

148148
[issue in `publish`]: https://github.com/getsentry/publish/issues
149149

150+
## Version name conventions
151+
152+
To keep versioning consistent across SDKs, we generally follow [semantic versioning (semver)](https://semver.org/), with language- or platform-specific conventions around semver (if applicable).
153+
Craft has some precautionary checks to ensure we only publish valid, semver-like versions.
154+
Specifically, craft expects versions following this format:
155+
156+
```txt
157+
<major>.<minor>.<patch>(-<prerelease>)?(-<build>)?
158+
```
159+
160+
While the major, minor and patch version numbers are required, pre-release and build properties are optional but can also be combined.
161+
162+
### Pre-releases (`<prerelease>`)
163+
164+
If you want to create a preview or pre-release of your SDK, you can append a pre-release identifier, as well as an optional incremental pre-release number to your version.
165+
This will ensure that various craft publishing targets will treat the release as a pre-release, meaning for example that it will not get assigned a `latest` tag in package repositories.
166+
Likewise, pre-releases will not be inserted into our internal release-registry, which is used by the Sentry product as well as our docs and other tools to query the latest or specific releases of our packages.
167+
168+
Importantly, we have strict rules around which identifiers we accept as a pre-release, meaning the `<prerelease>` part of your version has to be one of the following: `preview|pre|rc|dev|alpha|beta|unstable|a|b`.
169+
Therefore, we **do not accept** arbitrary strings as pre-release identifiers. Using any other identifiers will result in a release being considered stable instead. This means, it will get assigned a `latest` tag in package repositories and inserted into our release-registry.
170+
171+
Examples:
172+
173+
```txt
174+
// valid
175+
1.0.0-preview
176+
1.0.0-alpha.0
177+
1.0.0-beta.1
178+
1.0.0-rc.20
179+
1.0.0-a
180+
181+
// invalid or incorrectly treated
182+
1.0.0-foo
183+
1.0.0-canary.0
184+
```
185+
186+
#### Special Case: Post Releases
187+
188+
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`.
189+
Given that we only consider certain identifiers as [valid pre-release identifiers](#pre-releases-prerelease), post releases are considered stable releases.
190+
191+
### Build identifiers (`<build>`)
192+
193+
In some cases, you can append a build identifier to your version, for example if you release the same package version for different platforms or architectures.
194+
You can also combine build and pre-release identifiers but in this case, the pre-release identifier has to come first.
195+
196+
Examples:
197+
198+
```txt
199+
// valid
200+
1.0.0+x86_64
201+
1.0.0-rc.1+x86_64
202+
203+
// invalid or incorrectly treated
204+
1.0.0+rc.1+x86_64
205+
1.0.0+x86_64-beta.0
206+
```
207+
150208
## [Optional] Using Multiple Craft Configs in a Repo
151209

152210
In some cases, we need to maintain multiple or diverging publishing configs in a repository.
@@ -165,7 +223,7 @@ Add `craft_config_from_merge_target: true` when calling `getsentry/action-prepar
165223
jobs:
166224
release:
167225
runs-on: ubuntu-latest
168-
name: 'Release a new version'
226+
name: "Release a new version"
169227
steps:
170228
# ...
171229
- name: Prepare release

0 commit comments

Comments
 (0)