@@ -48,17 +48,34 @@ jobs:
4848 echo "Using CLAIM_DB_WORKER_URL=${CLAIM_DB_WORKER_URL}"
4949 echo "Using POSTHOG_API_HOST=${POSTHOG_API_HOST}"
5050
51- for pkg in $WORKSPACES; do
51+ # First, publish create-db
52+ echo "Publishing create-db to npm..."
53+ cd create-db
54+ export POSTHOG_API_HOST="${{ secrets.POSTHOG_API_HOST }}"
55+ export POSTHOG_API_KEY="${{ secrets.POSTHOG_API_KEY }}"
56+ CREATE_DB_VERSION=$(node -p "require('./package.json').version")
57+ if ! pnpm publish --access public --no-git-checks; then
58+ echo "Publish failed, trying to bump version and retry..."
59+ npm version patch --no-git-tag-version
60+ CREATE_DB_VERSION=$(node -p "require('./package.json').version")
61+ pnpm publish --access public --no-git-checks || echo "Publish failed again for create-db"
62+ fi
63+ cd ..
64+
65+ # Then publish create-pg and create-postgres with resolved dependencies
66+ for pkg in create-pg create-postgres; do
5267 echo "Publishing $pkg to npm..."
5368 cd "$pkg"
5469 export POSTHOG_API_HOST="${{ secrets.POSTHOG_API_HOST }}"
5570 export POSTHOG_API_KEY="${{ secrets.POSTHOG_API_KEY }}"
56- # pnpm publish --access public || echo "Publish failed for $pkg"
57- # First try to publish
58- if ! pnpm publish --access public; then
71+
72+ # Update dependency to use the published version instead of workspace:*
73+ npm pkg set dependencies.create-db="$CREATE_DB_VERSION"
74+
75+ if ! pnpm publish --access public --no-git-checks; then
5976 echo "Publish failed, trying to bump version and retry..."
6077 npm version patch --no-git-tag-version
61- pnpm publish --access public || echo "Publish failed again for $pkg"
78+ pnpm publish --access public --no-git-checks || echo "Publish failed again for $pkg"
6279 fi
6380 cd - >/dev/null
6481 done
0 commit comments