File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040 - name : Build
4141 run : bun run build
4242
43+ - name : Preflight publish context
44+ run : |
45+ set -euo pipefail
46+
47+ PACKAGE_NAME="$(node -p \"require('./package.json').name\")"
48+ PACKAGE_VERSION="$(node -p \"require('./package.json').version\")"
49+ TAG_NAME="${GITHUB_REF_NAME}"
50+
51+ echo "Repository: ${GITHUB_REPOSITORY}"
52+ echo "Workflow: ${GITHUB_WORKFLOW}"
53+ echo "Ref: ${GITHUB_REF}"
54+ echo "Tag: ${TAG_NAME}"
55+ echo "Package: ${PACKAGE_NAME}"
56+ echo "Version: ${PACKAGE_VERSION}"
57+
58+ echo "Current npm version (if already published):"
59+ npm view "${PACKAGE_NAME}" version || true
60+
61+ if [ "${TAG_NAME}" != "v${PACKAGE_VERSION}" ]; then
62+ echo "Tag (${TAG_NAME}) does not match package version (v${PACKAGE_VERSION})."
63+ exit 1
64+ fi
65+
4366 - name : Publish to npm (Trusted Publisher)
4467 run : npm publish --provenance --access public
4568
Original file line number Diff line number Diff line change 5858 "clean" : " rimraf .vite dist" ,
5959 "changelog" : " changelogen --output CHANGELOG.md" ,
6060 "changelog:bump" : " changelogen --bump --output CHANGELOG.md" ,
61- "release" : " bun run build && changelogen --release --output CHANGELOG.md && (git rev-parse -q --verify refs/tags/v$npm_package_version >/dev/null || git tag v$npm_package_version) && git push origin v$npm_package_version"
61+ "release" : " bun run build && changelogen --bump --output CHANGELOG.md && (git rev-parse -q --verify refs/tags/v$npm_package_version >/dev/null || git tag v$npm_package_version) && git push origin v$npm_package_version"
6262 },
6363 "publishConfig" : {
6464 "access" : " public"
You can’t perform that action at this time.
0 commit comments