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
7 changes: 7 additions & 0 deletions .changeset/weak-clouds-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"create-db": patch
"create-pg": patch
"create-postgres": patch
---

feat: update styles and migrate to v1 api
32 changes: 12 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Release CLIs

on:
workflow_dispatch:
push:
branches:
- main
Expand Down Expand Up @@ -35,51 +36,42 @@ jobs:
- name: ❌ Disable pnpm git-checks
run: pnpm config set git-checks false

# Copy README files before any version bump or publish
- name: 📄 Copy README to child CLIs
run: |
for pkg in create-pg create-postgres; do
cp create-db/README.md "$pkg/README.md"
done

# Configure npm for publishing
- name: 🔑 Configure npm auth
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.CREATE_DB_TOKEN_NPM }}" > ~/.npmrc

# Generate version updates with changesets (PR created if branch protected)
- name: 📝 Changesets Versioning
uses: changesets/action@v1
with:
version: pnpm changeset version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Publish packages to npm if changesets are applied
# Always publish the packages, regardless of changesets
- name: 🚀 Publish Each CLI Package
if: steps.changesets.outputs.hasChangesets == 'false'
run: |
# Export secrets for CLI usage
export CREATE_DB_WORKER_URL="${{ secrets.CREATE_DB_WORKER_URL }}"
export CLAIM_DB_WORKER_URL="${{ secrets.CLAIM_DB_WORKER_URL }}"

echo "Using CREATE_DB_WORKER_URL=$CREATE_DB_WORKER_URL"
echo "Using CLAIM_DB_WORKER_URL=$CLAIM_DB_WORKER_URL"

# Publish each package
for pkg in $WORKSPACES; do
echo "Publishing $pkg to npm..."
cd "$pkg"

# Stable patch bump
npm version patch --no-git-tag-version

# Publish to npm
pnpm publish --access public

pnpm publish --access public || echo "Publish failed for $pkg"
cd - >/dev/null
done
env:
NODE_AUTH_TOKEN: ${{ secrets.CREATE_DB_TOKEN_NPM }}

- name: 🧹 Cleanup npm auth
run: rm -f ~/.npmrc

# Finally, create a PR for version bump + changelogs
- name: 📝 Prepare Changesets PR
id: changesets
uses: changesets/action@v1
with:
version: pnpm changeset version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}