Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,39 @@ jobs:
# Confirms the workspace versions match the pushed tag and re-validates
# all three tarballs before anything reaches the registry.
- run: pnpm release:check "$GITHUB_REF_NAME"
# Each publish step skips a version the registry already has, so
# re-running this job after a partial publish resumes with the missing
# packages instead of failing on a republish conflict. npm view's exit
# code for a missing version varies across npm releases; compare its
# output instead.
- name: Publish @natui/core
working-directory: packages/natui
run: npm publish
run: |
version="$(node -p "require('./package.json').version")"
if [ "$(npm view "@natui/core@${version}" version 2>/dev/null || true)" = "${version}" ]; then
echo "@natui/core@${version} is already on the registry; skipping."
else
npm publish
fi
# @natui/dev declares its @natui/core peer with the workspace protocol,
# which only pnpm rewrites to a real version range. Pack with pnpm, then
# let npm publish the tarball so OIDC trusted publishing still applies.
- name: Publish @natui/dev
working-directory: packages/natui-dev
run: |
pnpm pack
npm publish "natui-dev-$(node -p "require('./package.json').version").tgz"
version="$(node -p "require('./package.json').version")"
if [ "$(npm view "@natui/dev@${version}" version 2>/dev/null || true)" = "${version}" ]; then
echo "@natui/dev@${version} is already on the registry; skipping."
else
pnpm pack
npm publish "natui-dev-${version}.tgz"
fi
- name: Publish create-natui-app
working-directory: packages/create-natui-app
run: npm publish
run: |
version="$(node -p "require('./package.json').version")"
if [ "$(npm view "create-natui-app@${version}" version 2>/dev/null || true)" = "${version}" ]; then
echo "create-natui-app@${version} is already on the registry; skipping."
else
npm publish
fi
5 changes: 3 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,6 @@ attestations automatically. All three packages must name `publish.yml` in
this repository as their trusted publisher: on npmjs.com, open each package's
Settings, then Trusted Publisher, and select GitHub Actions with this
repository and that workflow filename. A version already on the registry
cannot be republished; a failed run after a partial publish needs a new
patch version.
cannot be republished, but each publish step skips versions the registry
already has. After a partial publish, fix the cause and re-run the failed
job; it resumes with the missing packages.
Loading