Skip to content

fix: remove needs

fix: remove needs #22

Workflow file for this run

# .github/workflows/release.yml
name: Release all CLIs & Deploy CF Workers
on:
workflow_dispatch:
pull_request:
branches: [main]
types: [opened, synchronize]
push:
branches: [main]
env:
# Folders under repo root containing each CLI
WORKSPACES: create-db create-pg create-postgres
jobs:
# 1) On PRs: bump versions & CHANGELOGs via Changesets
version:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: πŸ›ŽοΈ Checkout full history
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: true
- name: 🀐 Disable Husky
run: echo "HUSKY=0" >> $GITHUB_ENV
- name: πŸ“¦ Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: πŸ”§ Install dependencies (allow lockfile changes)
run: pnpm install --workspace-root --no-frozen-lockfile
- name: πŸ”„ Version & changelogs via Changesets
uses: changesets/action@v1
with:
version: "pnpm changeset version --yes"
commit: "chore(release): bump [skip ci]"
commitMode: "git-cli"
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 2) On merge to main: aggregate CHANGELOGs, tag & publish each CLI
publish:
if: ${{ github.event_name == 'push' }}
needs: version
runs-on: ubuntu-latest
steps:
- name: πŸ›ŽοΈ Checkout full history
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: true
- name: 🀐 Disable Husky
run: echo "HUSKY=0" >> $GITHUB_ENV
- name: πŸ“¦ Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: πŸ”§ Install dependencies (strict lockfile)
run: pnpm install --workspace-root --frozen-lockfile
- name: πŸ”§ Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: πŸ“„ Copy root README to each CLI
run: |
for pkg in $WORKSPACES; do
cp README.md "$pkg/README.md"
done
- name: πŸ“‘ Aggregate changelogs
id: aggregate
run: |
NEW_VERSION=$(jq -r '.version' package.json)
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
echo "# Release v$NEW_VERSION" > AGGREGATED_CHANGELOG.md
for pkg in $WORKSPACES; do
echo "## $pkg" >> AGGREGATED_CHANGELOG.md
sed -n "/^## $NEW_VERSION/,/^## /p" "$pkg/CHANGELOG.md" \
| sed '1d;$d' \
>> AGGREGATED_CHANGELOG.md
echo "" >> AGGREGATED_CHANGELOG.md
done
- name: 🚩 Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: v${{ env.NEW_VERSION }}
release_name: Release v${{ env.NEW_VERSION }}
body_path: AGGREGATED_CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: πŸ”‘ Configure npm auth
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.CREATE_DB_TOKEN_NPM }}" > ~/.npmrc
- name: πŸš€ Publish each CLI individually
run: |
for pkg in $WORKSPACES; do
echo "Publishing $pkg@$NEW_VERSION…"
( cd "$pkg" && npm publish --access public )
done
# β€” CF Worker production deploys (uncomment when ready) β€”
# - name: ☁️ Deploy create-db-worker
# uses: cloudflare/wrangler-action@v3
# with:
# apiToken: ${{ secrets.CF_API_TOKEN }}
# accountId: ${{ secrets.CF_ACCOUNT_ID }}
# environment: production
# workingDirectory: create-db-worker
#
# - name: ☁️ Deploy claim-db-worker
# uses: cloudflare/wrangler-action@v3
# with:
# apiToken: ${{ secrets.CF_API_TOKEN }}
# accountId: ${{ secrets.CF_ACCOUNT_ID }}
# environment: production
# workingDirectory: claim-db-worker
- name: 🧹 Cleanup npm auth
if: ${{ always() }}
run: rm -f ~/.npmrc