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
61 changes: 43 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ name: Release

on:
push:
tags:
- "v*"
branches:
- main
workflow_dispatch:
inputs:
dry-run:
description: "Dry run (no actual release)"
required: false
type: boolean
default: false

jobs:
publish:
release:
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
Expand All @@ -19,29 +25,48 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: "pnpm"

- name: Update npm
run: npm install -g npm@latest

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build package
run: pnpm run pack:sdk

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
*.tgz
draft: false
prerelease: false
- name: Determine release mode
id: mode
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "dry_run=false" >> $GITHUB_OUTPUT
else
echo "dry_run=${{ inputs.dry-run }}" >> $GITHUB_OUTPUT
fi

- name: Release to NPM
run: pnpm run release
- name: Release
run: |
if [ "${{ steps.mode.outputs.dry_run }}" == "true" ]; then
pnpm release:dry
else
pnpm release:ci
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51 changes: 51 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$schema": "https://unpkg.com/release-it@19/schema/release-it.json",
"git": {
"commitMessage": "chore: release v${version}",
"tagName": "v${version}",
"tagAnnotation": "Release v${version}",
"requireBranch": "main",
"requireCleanWorkingDir": true,
"push": true,
"pushArgs": ["--follow-tags"]
},
"github": {
"release": true,
"releaseName": "v${version}",
"autoGenerate": false,
"draft": false,
"preRelease": false,
"tokenRef": "GITHUB_TOKEN"
},
"npm": false,
"hooks": {
"after:bump": "tsx tools/sync-versions.ts ${version}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not blocking: also update license file here

"before:release": "pnpm build && pnpm --filter=@databricks/appkit dist && pnpm --filter=@databricks/appkit-ui dist",
"after:release": "npm publish packages/appkit/tmp --access public --provenance && npm publish packages/appkit-ui/tmp --access public --provenance"
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": {
"name": "conventionalcommits",
"types": [
{ "type": "feat", "section": "Features" },
{ "type": "fix", "section": "Bug Fixes" },
{ "type": "perf", "section": "Performance Improvements" },
{ "type": "refactor", "section": "Code Refactoring" },
{ "type": "docs", "section": "Documentation" },
{ "type": "test", "section": "Tests" },
{ "type": "build", "section": "Build System" },
{ "type": "ci", "section": "Continuous Integration" },
{ "type": "chore", "section": "Chores", "hidden": true }
]
},
"writerOpts": {
"groupBy": "scope",
"commitGroupsSort": ["appkit", "appkit-ui"],
"commitsSort": ["type", "subject"]
},
"infile": "CHANGELOG.md",
"header": "# Changelog\n\nAll notable changes to this project will be documented in this file."
}
}
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Changelog

All notable changes to this project will be documented in this file.

56 changes: 56 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,62 @@ pnpm clean # Remove build artifacts
pnpm clean:full # Remove build artifacts + node_modules
```

### Releasing

This project uses [release-it](https://github.com/release-it/release-it) with [conventional-changelog](https://www.conventionalcommits.org/) for automated releases. Both packages (`appkit` and `appkit-ui`) are always released together with the same version.

#### GitHub Actions (Recommended)

Releases are automated via GitHub Actions and trigger in two ways:

**Automatic (on merge to main):**
- When PRs are merged to `main`, the workflow automatically runs
- Analyzes commits since last release using conventional commits
- If there are `feat:` or `fix:` commits, both packages are released together
- If no releasable commits, the release is skipped

**Manual (workflow_dispatch):**
1. Go to **Actions → Release → Run workflow**
2. Optionally enable "Dry run" to preview without publishing
3. Click "Run workflow"

**Permissions (already configured, no secrets needed):**
- `contents: write` - to push commits and tags
- `id-token: write` - for npm OIDC/provenance publishing

Both `GITHUB_TOKEN` and npm OIDC are provided automatically by GitHub Actions.

The workflow automatically:
- Builds all packages
- Bumps version based on conventional commits
- Updates `CHANGELOG.md`
- Creates git tag and GitHub release
- Publishes to npm

#### Local Release (Alternative)

**Prerequisites:**
- Be on `main` branch with a clean working directory
- Set `GITHUB_TOKEN` environment variable
- Be logged in to npm (`npm login`)

```bash
# Dry run (preview what will happen without making changes)
pnpm release:dry

# Interactive release (prompts for version bump)
pnpm release

# CI release (non-interactive, for automation)
pnpm release:ci
```

#### Version Bumps (Conventional Commits)

- `feat:` → Minor version bump (0.1.0 → 0.2.0)
- `fix:` → Patch version bump (0.1.0 → 0.1.1)
- `feat!:` or `BREAKING CHANGE:` → Major version bump (0.1.0 → 1.0.0)

## Architecture Overview

### Plugin System
Expand Down
19 changes: 18 additions & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
export default { extends: ["@commitlint/config-conventional"] };
export default {
extends: ["@commitlint/config-conventional"],
rules: {
"scope-enum": [
1,
"always",
[
"appkit", // @databricks/appkit
"appkit-ui", // @databricks/appkit-ui
"shared", // shared package
"playground", // dev-playground app
"docs", // documentation
"deps", // dependency updates
"release", // release commits
],
],
},
};
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "root",
"type": "module",
"private": true,
"version": "0.0.0",
"version": "0.0.2",
"packageManager": "pnpm@10.21.0",
"scripts": {
"build": "pnpm -r --filter=!docs build:package",
Expand All @@ -26,10 +26,11 @@
"format": "biome format --write .",
"lint:fix": "biome lint --write .",
"lint": "biome lint .",
"pack:sdk": "pnpm build && pnpm -r dist",
"pack:sdk": "pnpm build && pnpm -r tarball",
"prepare": "husky",
"release:dry": "pnpm run pack:sdk && pnpm --filter=@databricks/appkit release:dry && pnpm --filter=@databricks/appkit-ui release:dry",
"release": "pnpm run pack:sdk && pnpm --filter=@databricks/appkit release && pnpm --filter=@databricks/appkit-ui release",
"release": "release-it",
"release:dry": "release-it --dry-run",
"release:ci": "release-it --ci",
"setup:repo": "./tools/setup.sh",
"start": "NODE_ENV=production pnpm build:sdk && pnpm --filter=sdk-playground build:app && pnpm --filter=sdk-playground start:local",
"test:watch": "vitest",
Expand All @@ -46,6 +47,7 @@
"@biomejs/biome": "2.2.6",
"@commitlint/cli": "^19.8.0",
"@commitlint/config-conventional": "^19.8.0",
"@release-it/conventional-changelog": "^10.0.4",
"@testing-library/dom": "^10.4.1",
"@testing-library/react": "^16.3.0",
"@types/node": "^24.7.2",
Expand All @@ -54,9 +56,10 @@
"husky": "^9.1.7",
"jsdom": "^27.0.0",
"lint-staged": "^15.5.1",
"plop": "^4.0.4",
"pg": "^8.16.3",
"plop": "^4.0.4",
"publint": "^0.3.15",
"release-it": "^19.1.0",
"tsdown": "^0.15.7",
"tsx": "^4.20.6",
"turbo": "^2.6.1",
Expand Down
9 changes: 4 additions & 5 deletions packages/appkit-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@
"scripts": {
"build:package": "tsdown --config tsdown.config.ts",
"build:watch": "tsdown --config tsdown.config.ts --watch",
"dist": "tsx ../../tools/dist.ts && npm pack ./tmp --pack-destination ./tmp",
"release:dry": "pnpm dist && pnpm publish ./tmp --access public --dry-run --no-git-checks",
"release": "pnpm dist && pnpm publish ./tmp --access public --no-git-checks",
"typecheck": "tsc --noEmit",
"clean:full": "rm -rf dist node_modules tmp",
"clean": "rm -rf dist tmp",
"clean:full": "rm -rf dist node_modules tmp"
"dist": "tsx ../../tools/dist.ts",
"tarball": "tsx ../../tools/dist.ts && npm pack ./tmp --pack-destination ./tmp",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@hookform/resolvers": "^5.2.2",
Expand Down
9 changes: 4 additions & 5 deletions packages/appkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@
"scripts": {
"build:package": "tsdown --config tsdown.config.ts",
"build:watch": "tsdown --config tsdown.config.ts --watch",
"typecheck": "tsc --noEmit",
"dist": "tsx ../../tools/dist.ts && npm pack ./tmp --pack-destination ./tmp",
"release:dry": "pnpm run dist && pnpm publish ./tmp --access public --dry-run --no-git-checks",
"release": "pnpm dist && pnpm publish ./tmp --access public --no-git-checks",
"clean:full": "rm -rf dist node_modules tmp",
"clean": "rm -rf dist tmp",
"clean:full": "rm -rf dist node_modules tmp"
"dist": "tsx ../../tools/dist.ts",
"tarball": "tsx ../../tools/dist.ts && npm pack ./tmp --pack-destination ./tmp",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@databricks/sdk-experimental": "^0.15.0",
Expand Down
Loading