Skip to content
Merged
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
16 changes: 15 additions & 1 deletion .github/workflows/publish-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,23 @@ jobs:
- name: Run bindings formatter
run: |
pnpm biome ci
- name: Determine npm dist tag
id: detect_dist_tag
run: |
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" == *-* ]]; then
# Prerelease: derive tag from the prerelease identifier (e.g. 0.1.2-rc.0 -> rc)
TAG="${VERSION#*-}"
TAG="${TAG%%.*}"
echo "Prerelease version $VERSION.$TAG"
echo "tag_flag=--tag $TAG" >> "$GITHUB_OUTPUT"
else
echo "Stable version $VERSION -> npm default dist-tag"
echo "tag_flag=" >> "$GITHUB_OUTPUT"
fi
- name: Build and publish to npm
run: |
pnpm zapi build-artifacts --optimize ReleaseSafe
pnpm zapi prepublish
pnpm zapi publish --access public -- --provenance
pnpm zapi publish --access public -- --provenance ${{ steps.detect_dist_tag.outputs.tag_flag }}

Loading