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
14 changes: 12 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,21 @@ jobs:
- name: Build project
run: pnpm run build

- name: Check if version already exists
- name: Check version and determine publish tag
id: check-version
run: |
VERSION=$(node -p "require('./package.json').version")
PACKAGE_NAME=$(node -p "require('./package.json').name")

# Check if version contains beta
if [[ "$VERSION" == *"beta"* ]]; then
echo "tag=beta" >> $GITHUB_OUTPUT
echo "Version $VERSION contains beta, will publish with beta tag"
else
echo "tag=latest" >> $GITHUB_OUTPUT
echo "Version $VERSION is stable, will publish with latest tag"
fi

if npm view ${PACKAGE_NAME}@${VERSION} version > /dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "Version $VERSION already exists on npm, skipping publish"
Expand All @@ -54,5 +64,5 @@ jobs:

- name: Publish to npm
if: steps.check-version.outputs.exists == 'false'
run: npm publish --access public --provenance
run: npm publish --access public --provenance --tag ${{ steps.check-version.outputs.tag }}
continue-on-error: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ coverage/
*.tmp
*.temp

.firecrawl/
Loading