Skip to content

Commit ae29d98

Browse files
test: test package updates
1 parent 286eece commit ae29d98

File tree

2 files changed

+36
-8
lines changed

2 files changed

+36
-8
lines changed

.github/workflows/preview.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,28 @@ jobs:
9696
echo "Using CLAIM_DB_WORKER_URL=$CLAIM_DB_WORKER_URL"
9797
echo "Using POSTHOG_API_HOST=${POSTHOG_API_HOST}"
9898
99-
for pkg in $WORKSPACES; do
99+
# First, update create-db version and publish it
100+
cd create-db
101+
npm version prerelease --preid "$PRE_TAG" --no-git-tag-version
102+
NEW_VERSION=$(node -p "require('./package.json').version")
103+
pnpm publish --access public --tag pr${{ github.event.number }} --no-git-checks
104+
cd ..
105+
106+
# Then update create-pg and create-postgres to use the new create-db version
107+
for pkg in create-pg create-postgres; do
100108
cd "$pkg"
101109
export CREATE_DB_WORKER_URL
102110
export CLAIM_DB_WORKER_URL
103111
export POSTHOG_API_HOST="${POSTHOG_API_HOST}"
104112
export POSTHOG_API_KEY="${POSTHOG_API_KEY}"
105-
113+
114+
# Update dependency to use the published version instead of workspace:*
115+
npm pkg set dependencies.create-db="$NEW_VERSION"
116+
106117
npm version prerelease \
107118
--preid "$PRE_TAG" \
108119
--no-git-tag-version
109-
pnpm publish --access public --tag pr${{ github.event.number }}
120+
pnpm publish --access public --tag pr${{ github.event.number }} --no-git-checks
110121
cd - >/dev/null
111122
done
112123

.github/workflows/release.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)