Publishing
Publishing uploads a package release to the registry, where anyone can depend on it. A published version is permanent.
Before you publish
Publication applies stricter rules than a local build. Your manifest must:
- declare a
Namespaceyou own or maintain; - declare
MinRux, the oldest compiler release that can build the package; - describe a package, not a workspace; and
- carry no path dependencies — every dependency must resolve from the registry.
- use
Type = "SourceLibrary"; Rux 0.4.0 does not publish native binary artifacts.
[Manifest]
Version = 1
MinRux = "0.4.0"
[Package]
Namespace = "Acme"
Name = "Widget"
Version = "1.0.0"
Type = "SourceLibrary"
You also need an API token with the publish scope. Store it once with
rux login:
rux login
In CI, set RUX_TOKEN instead — it overrides any stored token.
Nothing about publishing builds or checks your package, so run rux check first.
rux pack and rux publish accept only SourceLibrary packages in Rux 0.4.0. They reject Executable, SharedLibrary, and StaticLibrary before credential lookup, archive creation, filesystem output, or network access. Binary distribution and binary dependency consumption will be enabled only by a later coordinated compiler and registry release.The package archive
A release is a single .ruxpkg file — a ZIP archive containing:
| Entry | Included when |
|---|---|
Rux.toml | Always, at the archive root |
Src/** | Always; at least one Src/**/*.rux is required |
README.md | Package.ReadmeFile names it |
LICENSE.md | Package.LicenseFile names it |
Build one without uploading anything:
rux pack
It is written to your build output directory as <Name>-<Version>.ruxpkg, or wherever --output says.
Entries are sorted and carry a fixed timestamp, so packing the same tree twice produces byte-identical
archives.
Limits: 5 MiB for the archive, 10 MiB expanded, 2 MiB for any single file, 64 KiB for the manifest, and 1,024 entries.
Publishing a release
Validate first — this does everything except upload, and needs no token:
rux publish --dry-run
Then publish:
rux publish
Packed Acme/Widget 1.0.0 (12 files, 24.1 KiB)
Uploading to https://api.rux-lang.dev
Published Acme/Widget 1.0.0
The release appears immediately at /packages/acme/widget.
Publishing a new version
Bump Package.Version and publish again. An existing version cannot be replaced — see
Versioning for how to choose the next number, and
Yanking if you need to withdraw one.
When publishing fails
Problems in your manifest or archive are reported locally, before anything is uploaded. The registry reports the rest.
| Message | Cause and fix |
|---|---|
publication requires [Package].Namespace | Add a Namespace to the manifest |
publication requires [Manifest].MinRux | Add MinRux, at least 0.4.0 |
dependency '…' uses Path = "…" | Replace the path dependency with a registry one |
a workspace cannot be published | Run the command from a member package |
[Package].Type = "…" cannot be published by Rux 0.4.0; this release publishes only Type = "SourceLibrary" | Change the package to SourceLibrary; native artifacts are local-only in 0.4.0 |
no credential for … | Run rux login, or set RUX_TOKEN |
namespace '…' is not claimed | Claim it first |
does not own or maintain namespace '…' | Ask an owner to invite you |
lacks the 'publish' scope | Create a token with the right scope |
version … is already published | Bump Package.Version — published versions are immutable |
Publishing to another registry
rux publish targets the official registry by default. --registry <url> or the RUX_REGISTRY_URL
environment variable points it somewhere else, which is how you exercise the whole flow against a local
registry before releasing for real.
rux login --registry http://localhost:8080
rux publish --registry http://localhost:8080
Credentials are stored per registry, so logging in to a local registry never sends it the token you use for the official one.