Publishing
Both registry names are n3-lib, with independent versions. Confirm name availability and publishing rights before release; a registry 404 is not a reservation. Never silently rename a package.
Initial Setup
- Enable Actions and select GitHub Actions as the Pages source.
- Create protected environments
npm,crates-ioandgithub-pages. - Configure npm trusted publishing for repository
AlicanC/n3-lib, workflowrelease-ts.yml, environmentnpm. A first authenticated manual publish may be required to establish ownership before configuring trusted publishing. - Store a scoped publishing token as
CARGO_REGISTRY_TOKENincrates-io. - Protect main and release tags, and require review for workflow changes.
Workflows do not create accounts or configure repository/registry settings.
environment: npm and environment: crates-io select GitHub deployment environments, not a package manager or a runner image. Both the string form and the Pages job's environment: { name, url } form are valid Actions syntax. Create/configure these names in repository Settings > Environments before releasing, including required reviewers where available. If deployment rules restrict refs, allow tags ts-v* in npm, tags rs-v* in crates-io, and the main branch in github-pages.
The Actions editor validates environment and secret names against the repository metadata it can access. A Value 'npm' is not valid or missing-secret warning can mean that setup is incomplete, the editor is signed into the wrong account, or cached metadata needs refreshing; changing to object syntax or adding quotes does not configure an environment. Store the crates.io token as an environment secret named CARGO_REGISTRY_TOKEN in crates-io. On npm's trusted publisher, the environment name must match npm exactly and direct npm publish must be allowed. Do not remove environment protections or hide these diagnostics just to make the editor check green.
TypeScript
Update lib-ts/package.json, its changelog and the npm lockfile. Published versions cannot be replaced; use a new version for the n3-lib rename. Run:
npm ci
npm run build:ts
npm run test:ts
npm run docs:ts
npm run check:package
npm run check:wasmCommit reviewed changes on main and push ts-vX.Y.Z matching the manifest. The protected workflow checks tag/ancestry, tests the package and publishes using OIDC provenance. It does not install Rust. Stable versions use latest; prereleases use next. A maintainer's manual first publication, after the same checks and local authentication, is npm publish -w n3-lib --access public.
Rust
Update lib-rs/Cargo.toml, its changelog and Cargo.lock. Run:
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace --locked
cargo doc -p n3-lib --no-deps --locked
cargo package -p n3-lib --locked
cargo publish -p n3-lib --dry-run --lockedPush rs-vX.Y.Z from the reviewed main commit matching the Cargo version. The protected workflow publishes only the native crate. The equivalent manual command is cargo publish -p n3-lib --locked. Prereleases follow Cargo semver.
Recovery And Pages
Registry versions are immutable. Retries skip an already published exact version and can complete a missing GitHub Release. Confirm that the existing registry artifact is intended before approving recovery; never reuse a version for different bytes or delete/recreate a tag. Publish a patch to fix a bad release; use crate yanks or npm deprecation where appropriate.
Fix credential/environment permissions before rerunning a reviewed job. Never print tokens. Documentation deployment is separate: main pushes or manual dispatch build guides, APIs and inspector into .artifacts/pages, deployed by the github-pages environment. The configured base is /n3-lib/; update links and inspector base together if renaming the repository.