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
25 changes: 25 additions & 0 deletions .github/workflows/release-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release checks
on:
pull_request:
branches: [main]
push:
branches: [main]
permissions:
contents: read
actions: read
concurrency:
group: release-checks-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
release-checks:
name: Release checks
runs-on: ${{ vars.CI_RUNNER_SMALL || 'ubuntu-latest' }}
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: marimo-team/internal-gh-actions/release-contract@36a2bd9a76109b91c9dc0bc65bfab95c9b632a3b
with:
workflows: |
test.yml
48 changes: 48 additions & 0 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Prepare release PR
on:
workflow_dispatch:
inputs:
version:
description: Stable X.Y.Z version or patch, minor, major
type: string
required: true
permissions: {}
concurrency:
group: prepare-release-pr
cancel-in-progress: false
jobs:
prepare:
if: github.ref == 'refs/heads/main'
runs-on: ${{ vars.CI_RUNNER_SMALL || 'ubuntu-latest' }}
environment: release
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: main
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
- name: Prepare versions
id: version
uses: marimo-team/internal-gh-actions/prepare-release@36a2bd9a76109b91c9dc0bc65bfab95c9b632a3b
with:
version: ${{ inputs.version }}
- name: Open release PR
id: pr
uses: marimo-team/internal-gh-actions/release-pr@36a2bd9a76109b91c9dc0bc65bfab95c9b632a3b
with:
app-id: ${{ vars.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
current-version: ${{ steps.version.outputs.current-version }}
manifest: ${{ steps.version.outputs.manifest }}
version: ${{ steps.version.outputs.version }}
files: ${{ steps.version.outputs.files }}
- name: Link release PR
env:
PR_URL: ${{ steps.pr.outputs.url }}
run: |
echo "$PR_URL" >> "$GITHUB_STEP_SUMMARY"
36 changes: 36 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tag merged release
on:
pull_request:
types: [closed]
branches: [main]
permissions: {}
jobs:
tag:
if: >-
github.event.pull_request.merged == true &&
github.event.pull_request.head.repo.full_name == github.repository &&
startsWith(github.event.pull_request.head.ref, 'release/') &&
startsWith(github.event.pull_request.title, 'release: ')
runs-on: ${{ vars.CI_RUNNER_SMALL || 'ubuntu-latest' }}
environment: release
timeout-minutes: 60
concurrency:
group: release-tag-${{ github.event.pull_request.number }}
cancel-in-progress: false
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
- name: Tag merged release
uses: marimo-team/internal-gh-actions/release-tag@3a52681ab8e200a34175ec8e5d14985e4e7ce3c3
with:
app-id: ${{ vars.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
manifest: package.json
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false
- name: Validate release tag
if: startsWith(github.ref, 'refs/tags/')
uses: marimo-team/internal-gh-actions/validate-release@3a52681ab8e200a34175ec8e5d14985e4e7ce3c3
with:
manifest: package.json

- name: ⎔ Setup pnpm
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6
Expand Down Expand Up @@ -130,9 +136,9 @@ jobs:
runs-on: "${{ vars.CI_RUNNER_SMALL || 'ubuntu-latest' }}"
steps:
- name: 📣 Notify release result
uses: marimo-team/internal-gh-actions/release-notification@91f15bebd3f322db6717ba5a17983928a47ec991 # main
uses: marimo-team/internal-gh-actions/release-notification@3a52681ab8e200a34175ec8e5d14985e4e7ce3c3
with:
status: ${{ (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) && 'failure' || 'success' }}
results: ${{ toJSON(needs) }}
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_RELEASES }}
artifact-url: "https://npmjs.com/package/@marimo-team/codemirror-sql"
permissions:
Expand Down
9 changes: 9 additions & 0 deletions .release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"repository": "marimo-team/codemirror-sql",
"files": ["package.json"],
"command": ["pnpm", "release"],
"docs": "RELEASING.md",
"checks": [["pnpm", "install", "--lockfile-only", "--frozen-lockfile", "--ignore-scripts"]],
"manifest": "package.json",
"prepare": ["npm", "version", "--no-git-tag-version", "--ignore-scripts", "--package-lock=false"]
}
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ pnpm run demo # vite build of demo/
```

- Browser tests need Playwright browsers installed first: `pnpm exec playwright install`.
- Release: `pnpm run release` (pnpm version) bumps + tags; pushing a `v*` tag triggers release.yml, which publishes to npm via OIDC.
- Release: `./scripts/release.sh patch` requests a release PR; see [RELEASING.md](RELEASING.md).
10 changes: 2 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,9 @@ Types:
- test: Adding or updating tests
- chore: Changes to build process or auxiliary tools

## Release Process
## Releases

For maintainers only:

```bash
git checkout main
git pull
npx bumpp --no-git-check=false
```
See [Releases](RELEASING.md) for the release PR workflow.

## Questions?

Expand Down
11 changes: 11 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Releases

Maintainers request a release with an authenticated GitHub CLI:

```sh
pnpm release patch
```

Accepts `patch`, `minor`, `major`, or a stable `X.Y.Z` version.
Review and merge the generated PR to approve publication.
See the [maintainer runbook](https://github.com/marimo-team/github-maintenance/blob/main/docs/releases.md) (internal).
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"demo": "vite build",
"build": "tsc",
"prepublishOnly": "pnpm run typecheck && pnpm run test && pnpm run build",
"release": "pnpm version",
"release": "bash scripts/release.sh",
"test:browser": "vitest --project browser"
},
"keywords": [
Expand Down
11 changes: 11 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ "$#" != 1 || "$1" == -h || "$1" == --help ]]; then
printf 'Usage: %s <patch|minor|major|X.Y.Z>\n' "$0" >&2
exit 2
fi
if [[ ! "$1" =~ ^(patch|minor|major|(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*))$ ]]; then
printf 'Expected patch, minor, major, or a stable X.Y.Z version.\n' >&2
exit 2
fi
exec gh workflow run release-pr.yml --repo marimo-team/codemirror-sql --ref main -f "version=$1"
Loading