Die Entwickler-Doku gibt es nur auf Englisch.
Publish releases from CI
Your build pipeline can publish a release by itself: create the release (or find it), upload its files and publish it, in one step. release-tool publish does this against the Management API. A GitHub Action and a GitLab CI template wrap it.
Every step can run again. A rerun with the same arguments finds the same release, skips files the release already holds with the same checksum and does not publish twice, so a failed or repeated pipeline job never creates a duplicate.
Pre-release.
release-toolis not published as a binary yet. The Action and the template build it from source withcargo install, or use a binary you provide.
What you need
- An API key with the
releases:writescope, stored as a secret of your pipeline, or no stored key at all: GitHub Actions and GitLab CI jobs can sign in with their OIDC token. The key's environment decides where the release goes: amk_test_...key publishes to test, amk_live_...key to live. Use a separate key for CI, so you can revoke it alone. - Bind the CI key to the product it publishes: create it with
product_id(POST /v1/api-keyswith{"name": "CI", "scopes": ["releases:write"], "product_id": "prod_..."}). A bound key reaches only that product: another product of your team does not exist for it, and it can carry onlyreleases:read,releases:write,products:read,symbols:writeandassets:write. If the key leaks, it cannot touch your other products, licenses or customers. In the dashboard, choose the product under API keys, Create API key. - The product ID (
prod_...). - The base URL of the Management API.
The command
export RELEASE_API_URL=https://api.example.com
export RELEASE_API_KEY=mk_live_... # from your pipeline's secrets
release-tool publish --product prod_... --version 2.4.0 \
--notes en=notes/2.4.0.en.md --notes de=notes/2.4.0.de.md \
windows=dist/app-2.4.0.msi linux=dist/app-2.4.0.tar.gz macos=dist/app-2.4.0.dmg
| Argument | Meaning |
|---|---|
--product <id> |
Product of the release. Required. |
--version <semver> |
Version, such as 2.4.0 or 2.5.0-beta.1. Required. |
--channel <name> |
Release channel, default stable. The channel must exist. |
--notes <en|de>=<file.md> |
Release notes for a language from a Markdown file. Can be given once per language. |
--min-from <semver> |
Lowest app version a device may update from (stepping stone). |
--draft |
Upload the files but leave the release a draft, for a manual check before publishing. |
--encrypt |
Encrypt every file before the upload, see Encrypted files. |
<platform>=<path> |
One file per platform: windows, macos, linux, ios or android. At least one. Devices download it under its file name. |
What it does:
- Creates the release as a draft with the platforms of the files, or finds the existing release of that version in that channel. An existing draft gets the given platforms, notes and
--min-from. - For each file: skips it if the release holds it already (same platform, name and SHA-256). Otherwise announces it, uploads it straight to the file store with the presigned URL and completes it. A file an earlier run uploaded but did not complete is completed without a second upload.
- Publishes the release, unless
--draftis given or it is published already.
A published release keeps its files. If the version is published with other files, the run fails with release_not_draft: publish a new version instead.
Network errors, rate limits and 502, 503 and 504 answers are retried three times. Uploads have no overall time limit, only a connection timeout.
Encrypted files
With --encrypt, the store and its download links hold only ciphertext; a device gets the file's key wrapped for it with each download (Rust SDK). The command fetches the product's wrapping key (GET /v1/products/{id}/wrapping-key), encrypts each file like release-tool encrypt into a temporary file, uploads that and removes it. The API key needs products:read in addition to releases:write; for an OIDC trust, add products:read to its scopes.
Each run encrypts with a fresh random key, so the ciphertext and its SHA-256 differ every time. The command therefore sends the SHA-256 of the file before encryption along (encryption.source_sha256), and a rerun finds the file by it and does not upload it again. Devices never see that checksum. In the output, sha256 and size_bytes are those of the ciphertext, source_sha256 that of your file, and encrypted is true.
Use --encrypt on every run of a version: without it, an encrypted file of the release does not count as the same file.
Output
The command prints one JSON object on stdout:
{
"release": {"id": "rel_...", "product_id": "prod_...", "environment": "live", "version": "2.4.0", "channel": "stable", "status": "published"},
"created": true,
"published": true,
"files": [
{"id": "rfl_...", "platform": "windows", "filename": "app-2.4.0.msi", "size_bytes": 48211968, "sha256": "…", "uploaded": true}
]
}
created and published say whether this run created or published the release; uploaded whether this run uploaded the file. On a rerun all three are false.
On failure it prints {"error": {"code": "...", "message": "...", "status": 403}} (status is the HTTP status, or null) and a line on stderr.
Exit codes
These codes stay stable, so your pipeline may branch on them.
| Code | Meaning | Run again? |
|---|---|---|
| 0 | Published, or already published with the same files. With --draft: the draft holds every file. |
|
| 2 | Bad arguments, RELEASE_API_URL missing, neither RELEASE_API_KEY nor RELEASE_OIDC_TRUST set, or a trust but no OIDC token. |
After fixing the job |
| 3 | A local file is missing, unreadable or empty, or cannot be encrypted (encrypt_failed). |
After fixing the build |
| 4 | The API key was refused (401) or lacks releases:write (403), or the OIDC token was refused (oidc_token_refused) or used before (oidc_token_reused). |
After fixing the key or the trust |
| 5 | The API refused the request, such as release_not_draft, an unknown product or channel, or an invalid version. |
No |
| 6 | The API or the file store is unavailable, or the CI did not hand out an OIDC token (oidc_token_unavailable). |
Yes, it is safe |
GitHub Actions
The Action is in sdks/ci/github/publish-release of the repository. Without tool-path it builds release-tool from the same repository and ref as the Action, which needs a Rust toolchain on the runner (present on GitHub's hosted runners).
on:
push:
tags: ["v*"]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./build.sh # writes dist/
- id: publish
uses: <owner>/<repo>/sdks/ci/github/publish-release@<tag>
with:
api-url: https://api.example.com
api-key: ${{ secrets.RELEASE_API_KEY }}
product: prod_...
version: ${{ github.ref_name }} # a leading v is dropped
notes-en: notes/en.md
files: |
windows=dist/app.msi
linux=dist/app.tar.gz
- run: echo "Published ${{ steps.publish.outputs.release-id }}"
Inputs: api-url, product, version, files (one <platform>=<path> per line) are required, and either api-key or oidc-trust (see below); oidc-audience, channel, notes-en, notes-de, min-from, draft, encrypt and tool-path are optional. Outputs: release-id, status and result (the JSON above). The step fails with the exit code of release-tool.
GitLab CI
The template is sdks/ci/gitlab/publish-release.yml. Include it and extend the hidden job .publish-release. Store RELEASE_API_URL and RELEASE_API_KEY as masked CI/CD variables.
include:
- remote: "<raw URL of sdks/ci/gitlab/publish-release.yml at a tag>"
publish:
extends: .publish-release
stage: deploy
needs: [build]
rules:
- if: $CI_COMMIT_TAG
variables:
RELEASE_PRODUCT: prod_...
RELEASE_TOOL_GIT: https://github.com/<owner>/<repo>
RELEASE_TOOL_REV: <tag>
RELEASE_FILES: |
windows=dist/app.msi
linux=dist/app.tar.gz
Variables: RELEASE_PRODUCT and RELEASE_FILES are required. RELEASE_VERSION defaults to the tag ($CI_COMMIT_TAG, a leading v dropped). Optional: RELEASE_CHANNEL, RELEASE_NOTES_EN, RELEASE_NOTES_DE, RELEASE_MIN_FROM, RELEASE_DRAFT, RELEASE_ENCRYPT. Give either RELEASE_TOOL_PATH (a binary in the job) or RELEASE_TOOL_GIT and RELEASE_TOOL_REV to build it. The job keeps the JSON output as the artifact release.json.
Sign in with the job's OIDC token
GitHub Actions and GitLab CI give each job a signed ID token that names its repository, ref and environment. Instead of storing an API key, you trust a repository once; its jobs then exchange their token for a key that is bound to one product and expires after 15 minutes. Nothing long-lived sits in your pipeline's secrets.
The operator of the API turns this on (OIDC_AUDIENCE). Without it, the exchange answers 503 oidc_unavailable.
Trust a repository
In the dashboard: API keys, section Sign-in from CI, Trust a repository. After saving, it shows the trust ID and the audience for your pipeline. With the API:
curl -X POST https://api.example.com/v1/oidc-trusts \
-H "Authorization: Bearer $ADMIN_KEY" -H "Content-Type: application/json" \
-d '{"product_id": "prod_...", "name": "Release tags", "provider": "github",
"repository": "acme/app", "repository_id": "123456789",
"ref_pattern": "refs/tags/v*", "ci_environment": "release"}'
| Field | Meaning |
|---|---|
product_id |
The only product the jobs reach. Required. |
provider |
github or gitlab. Required. |
repository |
owner/name on GitHub, the project path (group/project) on GitLab. Required, compared without case. |
repository_id |
Numeric ID of the repository or project. Recommended: without it, the ID of the first job that signs in is kept, so a repository deleted and created again under the same name by someone else is not trusted. |
ref_pattern |
Only jobs for this ref: exact (refs/heads/main) or with a trailing * (refs/tags/v*). Without it, every branch and tag, including pull requests from branches of the repository. Set it. |
ci_environment |
Only jobs in this deployment environment (GitHub environment:, GitLab environment:). Combine it with environment protection rules, so a release needs an approval or a protected branch. |
scopes |
Default ["releases:write"]; only releases:read, releases:write, products:read, symbols:write and assets:write. |
issuer |
Only for GitHub Enterprise Server or self-managed GitLab, and only an issuer the operator allows. |
The trust lives in the environment of the key that creates it: a trust created with a mk_live_... key publishes to live. Creating one needs api_keys:write and every scope the trust grants. The answer carries audience: the value the job must ask its token for, usually the API URL. GET /v1/oidc-trusts lists trusts, DELETE /v1/oidc-trusts/{id} removes one and revokes the keys it issued that are still valid.
Each token is accepted once. A token older than 6 hours, for another audience, from another repository or ref, or not signed by the provider is refused with 401 oidc_token_refused; the message does not say which check failed.
GitHub Actions
Give the job id-token: write and pass oidc-trust instead of api-key:
jobs:
release:
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- run: ./build.sh
- uses: <owner>/<repo>/sdks/ci/github/publish-release@<tag>
with:
api-url: https://api.example.com
oidc-trust: oit_...
product: prod_...
version: ${{ github.ref_name }}
files: |
linux=dist/app.tar.gz
oidc-audience defaults to api-url; set it if the trust shows another audience.
GitLab CI
Request the token with id_tokens and set RELEASE_OIDC_TRUST instead of RELEASE_API_KEY:
publish:
extends: .publish-release
environment: release
id_tokens:
RELEASE_OIDC_TOKEN:
aud: https://api.example.com
variables:
RELEASE_OIDC_TRUST: oit_...
RELEASE_PRODUCT: prod_...
RELEASE_TOOL_GIT: https://github.com/<owner>/<repo>
RELEASE_TOOL_REV: <tag>
RELEASE_FILES: |
linux=dist/app.tar.gz
Without the Action
release-tool publish signs in by itself when RELEASE_API_KEY is empty and RELEASE_OIDC_TRUST is set. It takes the token from RELEASE_OIDC_TOKEN, or on GitHub Actions requests it with the audience RELEASE_OIDC_AUDIENCE (default RELEASE_API_URL). The exchange itself is POST /v1/oidc/token with {"trust_id": "oit_...", "token": "<JWT>"} and no Authorization header; it answers 201 with secret (use as Bearer), product_id, scopes and expires_at.
Test licenses for end-to-end tests
Your pipeline can create licenses in the test environment, run the app against them and revoke them afterwards:
export RELEASE_API_URL=https://api.example.com
export RELEASE_API_KEY=mk_test_... # test key with licenses:write
release-tool test-license create --plan plan_... --quantity 2 --tag ci
release-tool test-license revoke lic_... lic_...
create prints {"licenses": [{"id": "lic_...", "key": "...", "plan_id": "...", "product_id": "...", "state": "active"}]}; --quantity is 1 to 100, --tag can be given several times. revoke prints each license with revoked: true and already: true if it was revoked before, so a cleanup step can run again. The exit codes are those of publish.
Only a test key is accepted: with a mk_live_... key the command stops with exit code 2 before any request goes out, and an answer about a license outside the test environment ends it with exit code 5. Use a key of its own for this, not the release key: a key bound to a product cannot carry licenses:write, and neither can an OIDC trust.
In GitHub Actions, for example:
- id: licenses
run: echo "key=$(release-tool test-license create --plan plan_... | jq -r '.licenses[0].key')" >> "$GITHUB_OUTPUT"
env:
RELEASE_API_URL: https://api.example.com
RELEASE_API_KEY: ${{ secrets.TEST_LICENSE_KEY }}
- run: ./e2e.sh "${{ steps.licenses.outputs.key }}"
Debug symbols for crash reports
If your app sends crash reports with native frames, upload the Breakpad symbol file of each build, made with dump_syms:
release-tool symbols --product prod_... app.sym libengine.sym
The key or OIDC trust needs symbols:write. The tool reads debug ID and module from each file's MODULE line, uploads and completes it, and prints {"symbols": [{"id": "dsy_...", "debug_id": "...", "module": "app", "status": "ready", "file": "app.sym"}]}. A file without a MODULE line stops it with exit code 3; the other exit codes are those of publish.
Assets
Assets such as models or content packs are uploaded with release-tool asset, one file per run:
release-tool asset --product prod_... --name voice-de-2 --entitlement voices \
--group voice --default --title en="German voice" --title de="Deutsche Stimme" voice-de.onnx
- Visibility has no default, so a forgotten flag cannot make a paid asset public: give
--entitlement <code>(only plans that grant it) or--visibility publicor--visibility unlisted. --groupwith--defaultmakes the asset the default of its group and takes the default from the others.--titleand--descriptiontakeen=<text>orde=<text>.- The key or OIDC trust needs
assets:write. The tool announces, uploads and completes the file and prints{"asset": {"id": "ast_...", "name": "voice-de-2", "status": "ready", "visibility": "entitled", "file": "voice-de.onnx", "unchanged": false}}. - The name never changes; new content gets a new name. Running again with the same file is safe and prints
"unchanged": true. Another file under a name that is ready stops the run withname_takenand exit code 5. The other exit codes are those ofpublish. --encryptencrypts the file for the product's wrapping key, aspublish --encryptdoes, into a temporary file, so the store only holds ciphertext (assets). The key then also needsproducts:read. The announcement carries the SHA-256 of the plaintext, and a rerun with the same file prints"unchanged": truewithout encrypting again. An asset of that name that is not encrypted, or encrypted from another file, stops the run withname_taken.- Change texts, group or visibility later in the dashboard or with
PATCH /v1/assets/{id}.
Other pipelines
Any pipeline that can run a binary works: set RELEASE_API_URL and RELEASE_API_KEY from its secret store (or RELEASE_OIDC_TRUST and RELEASE_OIDC_TOKEN if the pipeline issues OIDC tokens from GitHub or GitLab), run release-tool publish and act on the exit code.
Signed release lists (Rust SDK) stay a separate step: after publish, sign the list with release-tool sign and upload it.