-
Notifications
You must be signed in to change notification settings - Fork 30
chore: copy Plate release CI setup #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Monorepo install (bun) | ||
| description: Install Bun workspace dependencies with cache enabled | ||
| inputs: | ||
| cwd: | ||
| description: "Changes the install working directory" | ||
| required: false | ||
| default: "." | ||
| frozen-lockfile: | ||
| description: "Run install with --frozen-lockfile" | ||
| required: false | ||
| default: "true" | ||
| generate: | ||
| description: "Run bun gen after install" | ||
| required: false | ||
| default: "false" | ||
|
|
||
| runs: | ||
| using: composite | ||
|
|
||
| steps: | ||
| - name: βοΈ Install bun | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version-file: package.json | ||
|
|
||
| - name: βοΈ Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
|
|
||
| - name: β»οΈ Setup bun cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.bun/install/cache | ||
| key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-bun- | ||
|
|
||
| - name: π₯ Install dependencies | ||
| shell: bash | ||
| working-directory: ${{ inputs.cwd }} | ||
| run: | | ||
| args=(install) | ||
|
|
||
| if [ "${{ inputs.frozen-lockfile }}" = "true" ]; then | ||
| args+=(--frozen-lockfile) | ||
| else | ||
| args+=(--no-frozen-lockfile) | ||
| fi | ||
|
|
||
| bun "${args[@]}" | ||
| env: | ||
| HUSKY: "0" | ||
|
|
||
| - name: π§± Generate local artifacts | ||
| if: ${{ inputs.generate == 'true' }} | ||
| shell: bash | ||
| working-directory: ${{ inputs.cwd }} | ||
| run: bun gen |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <!-- Prompt structure adapted from sst/opencode and Better Auth release automation. --> | ||
|
|
||
| You are rewriting release notes for KitCN, an open-source Convex toolkit for | ||
| auth, ORM, React Query, and CLI workflows. | ||
|
|
||
| ## Input | ||
|
|
||
| **Raw changelog:** __RAW_CHANGELOG_PATH__ | ||
|
|
||
| The raw changelog is generated from Changesets package changelogs after publish. | ||
| It is grouped by npm package and change type. | ||
|
|
||
| ## Job | ||
|
|
||
| Rewrite each entry into a polished, user-focused release note while preserving | ||
| the exact release structure. Describe what changed for KitCN users, not just the | ||
| internal implementation. | ||
|
|
||
| ## Writing Rules | ||
|
|
||
| - Keep every entry as one clear sentence unless the raw entry already contains a | ||
| migration block or code example. | ||
| - Keep code identifiers in backticks. | ||
| - Keep PR links, author links, and package names. | ||
| - Keep migration notes, especially under `### Major Changes`. | ||
| - Do not add `CHANGELOG` links. The workflow injects per-package links after | ||
| validation. | ||
| - Do not invent package summaries. | ||
| - Do not add or remove release entries. | ||
| - Do not use em dashes. | ||
|
|
||
| ## Structural Rules | ||
|
|
||
| - Do not modify `## \`package-name\`` headings or their order. | ||
| - Do not modify `### Major Changes`, `### Minor Changes`, or | ||
| `### Patch Changes` headings or their order. | ||
| - Do not add standalone `## Contributors` sections. | ||
| - Do not add standalone `Full changelog: [\`...\`](...)` links. | ||
| - Preserve all PR links in the raw changelog. | ||
| - Preserve all migration-note blocks. | ||
|
|
||
| Write the final release notes to: __RAW_CHANGELOG_PATH__.final |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries | ||
| name: Cleanup caches for closed branches | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| cleanup: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: π§Ή Cleanup caches | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| REPO: ${{ github.repository }} | ||
| BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge | ||
| run: | | ||
| # Install GitHub CLI cache extension | ||
| gh extension install actions/gh-actions-cache | ||
|
|
||
| echo "Fetching list of cache keys..." | ||
| cacheKeys=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1) | ||
|
|
||
| # Continue even if some cache deletions fail | ||
| set +e | ||
|
|
||
| if [ -z "$cacheKeys" ]; then | ||
| echo "No caches found to delete" | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "Deleting caches..." | ||
| for cacheKey in $cacheKeys; do | ||
| echo "Deleting cache: $cacheKey" | ||
| gh actions-cache delete "$cacheKey" -R $REPO -B $BRANCH --confirm | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this workflow runs in a repository/org with restricted default Useful? React with πΒ / π. |
||
| done | ||
|
|
||
| echo "Cache cleanup completed" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this workflow is triggered by a closed PR from a fork,
pull_requestruns with a read-onlyGITHUB_TOKEN, so the later cache delete call still cannot remove Actions caches even if the workflow requestsactions: write. Since this cleanup does not need to execute PR code, usepull_request_targetor explicitly skip fork PRs; otherwise fork PR caches remain after close.Useful? React with πΒ / π.