mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-06-03 08:46:40 +00:00
Add GitHub Actions workflow for npm trusted publishing via OIDC. The workflow validates package version bumps on PRs with npm publish dry-runs, publishes changed workspace packages from main-xahau, and creates matching GitHub releases. Shared npm publish logic is implemented as a local composite action used by both dry-run and publish jobs.
19 lines
409 B
Bash
19 lines
409 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
package_spec="$1"
|
|
stderr_file="$(mktemp)"
|
|
|
|
if npm view "$package_spec" version --registry "https://registry.npmjs.org" 2>"$stderr_file"; then
|
|
echo "$package_spec is already published." >&2
|
|
exit 1
|
|
fi
|
|
|
|
if grep -Eq "E404|404 Not Found|is not in this registry" "$stderr_file"; then
|
|
echo "$package_spec is not published yet."
|
|
exit 0
|
|
fi
|
|
|
|
cat "$stderr_file" >&2
|
|
exit 1
|