Skip to content

Commit 535dcd8

Browse files
committed
Tag npm prerelease publications
1 parent 5ff8f46 commit 535dcd8

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/release-codecs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ jobs:
109109
if npm view "${package_name}@${package_version}" version >/dev/null 2>&1; then
110110
echo "${package_name}@${package_version} is already published; skipping."
111111
else
112-
npm publish "${packages[0]}" --access public
112+
npm_tag=latest
113+
if [[ "$package_version" == *-* ]]; then
114+
npm_tag=preview
115+
fi
116+
npm publish "${packages[0]}" --access public --tag "$npm_tag"
113117
fi
114118
115119
publish-pypi:

.github/workflows/release-model.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ jobs:
109109
if npm view "${package_name}@${package_version}" version >/dev/null 2>&1; then
110110
echo "${package_name}@${package_version} is already published; skipping."
111111
else
112-
npm publish "${packages[0]}" --access public
112+
npm_tag=latest
113+
if [[ "$package_version" == *-* ]]; then
114+
npm_tag=preview
115+
fi
116+
npm publish "${packages[0]}" --access public --tag "$npm_tag"
113117
fi
114118
115119
publish-pypi:

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ When adding tests:
223223
- `release-model.yml` and `release-codecs.yml` each rerun core and portable gates, pack once, preserve that build as a workflow artifact, and publish it through independent NuGet, npm, and PyPI jobs from a protected `release` environment. A failed registry job must be retriable without rebuilding or rerunning successful registry jobs. Release Model before Codecs when both versions change.
224224
- `release-all.yml` is an orchestration convenience only. It validates release metadata, checks the exact committed versions on NuGet/npm/PyPI, and dispatches the existing package-specific workflows for incomplete versions. It must never publish directly or replace their trusted-publisher identities.
225225
- Model and Codecs NuGet trusted-publisher policies must name their direct workflow (`release-model.yml` or `release-codecs.yml`). Client and Interop policies must name the called reusable workflow `release-package.yml`, which NuGet observes through `job_workflow_ref`.
226-
- npm trusted-publisher policies for the scoped Model and Codecs packages must name the corresponding direct package workflow and allow `npm publish`. These workflows use Node 24, npm with trusted-publishing support, and no npm token.
226+
- npm trusted-publisher policies for the scoped Model and Codecs packages must name the corresponding direct package workflow and allow `npm publish`. These workflows use Node 24, npm with trusted-publishing support, and no npm token. They publish prerelease versions with the `preview` dist-tag and stable versions with `latest`.
227227
- PyPI trusted-publisher policies for Model and Codecs must name the corresponding direct, top-level package workflow. Do not move PyPI publishing into a reusable workflow.
228228
- NuGet trusted-publishing policies are owner-wide and cannot be scoped to an
229229
individual package. The current policy owner and package owner is the

docs/operations/releases.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ Each npm package can have only one trusted publisher. The values are
191191
case-sensitive and the workflow filename includes `.yml`. No `NPM_TOKEN`
192192
secret is used. Keep the packages in the `nfdi4plants` npm scope and grant
193193
maintainer access through the npm organization rather than a personal scope.
194+
The workflows explicitly publish prerelease versions with the `preview`
195+
dist-tag and stable versions with `latest`; npm rejects prerelease publication
196+
without a non-`latest` tag.
194197

195198
On pypi.org, open each project under **Manage → Publishing**, add a GitHub
196199
Actions trusted publisher, and enter:

0 commit comments

Comments
 (0)