Skip to content
Open
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
131 changes: 131 additions & 0 deletions .github/workflows/appkit-agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: appkit-agent

on:
push:
branches:
- main
paths:
- "integrations/appkit-agent/**"
- ".github/workflows/appkit-agent.yml"
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
paths:
- "integrations/appkit-agent/**"
- ".github/workflows/appkit-agent.yml"
workflow_dispatch:

defaults:
run:
working-directory: integrations/appkit-agent

jobs:
test:
runs-on: ubuntu-latest
name: "test (node: ${{ matrix.node-version }})"
strategy:
matrix:
node-version: ["20", "22"]
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
cache-dependency-path: integrations/appkit-agent/pnpm-lock.yaml

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

- name: Run tests
run: pnpm run test

typecheck:
runs-on: ubuntu-latest
name: typecheck
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
cache-dependency-path: integrations/appkit-agent/pnpm-lock.yaml

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

- name: Run typecheck
run: pnpm run typecheck

format:
runs-on: ubuntu-latest
name: format
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
cache-dependency-path: integrations/appkit-agent/pnpm-lock.yaml

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

- name: Check formatting
run: pnpm run format:check

build:
runs-on: ubuntu-latest
name: build
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
cache-dependency-path: integrations/appkit-agent/pnpm-lock.yaml

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

- name: Build package
run: pnpm run build
115 changes: 115 additions & 0 deletions .github/workflows/release-appkit-agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Release @databricks/appkit-agent

on:
workflow_dispatch:
inputs:
production:
description: "Publish to npm? (If unchecked, will publish with --tag next)"
required: true
default: false
type: boolean

jobs:
release:
runs-on: ubuntu-latest

permissions:
id-token: write
contents: write
environment:
name: ${{ inputs.production && 'npm' || 'npm-next' }}
url: https://www.npmjs.com/package/@databricks/appkit-agent
defaults:
run:
working-directory: integrations/appkit-agent
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
cache-dependency-path: integrations/appkit-agent/pnpm-lock.yaml

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

- name: Get package version
id: get-version
run: |
PKG_VERSION=$(node -p "require('./package.json').version")
echo "version=$PKG_VERSION" >> $GITHUB_OUTPUT

- name: Clean
run: pnpm run clean

- name: Build
run: pnpm run build

- name: Test
run: pnpm run test

- name: Typecheck
run: pnpm run typecheck

- name: Publish to npm
if: inputs.production
run: pnpm publish --access public --provenance --no-git-checks

- name: Publish to npm (next tag)
if: ${{ !inputs.production }}
run: pnpm publish --access public --tag next --provenance --no-git-checks

- name: Wait for registry propagation
run: sleep 15

- name: Smoke test (production)
if: inputs.production
run: |
PKG_VERSION=${{ steps.get-version.outputs.version }}
mkdir -p /tmp/smoke-test
cd /tmp/smoke-test
npm install @databricks/appkit-agent@$PKG_VERSION
INSTALLED_VERSION=$(node -p "require('./node_modules/@databricks/appkit-agent/package.json').version")
echo "Expected: $PKG_VERSION"
echo "Installed: $INSTALLED_VERSION"
if [ "$PKG_VERSION" != "$INSTALLED_VERSION" ]; then
echo "Version mismatch!"
exit 1
fi
echo "Smoke test passed!"

- name: Smoke test (next tag)
if: ${{ !inputs.production }}
run: |
mkdir -p /tmp/smoke-test
cd /tmp/smoke-test
npm install @databricks/appkit-agent@next
INSTALLED_VERSION=$(node -p "require('./node_modules/@databricks/appkit-agent/package.json').version")
echo "Installed @next version: $INSTALLED_VERSION"
echo "Smoke test passed!"

- name: Generate package link
run: |
PKG_VERSION=${{ steps.get-version.outputs.version }}
if [ "${{ inputs.production }}" == "true" ]; then
LINK="https://www.npmjs.com/package/@databricks/appkit-agent/v/$PKG_VERSION"
echo "## :rocket: Package Released" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**@databricks/appkit-agent v$PKG_VERSION** has been published to npm!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo ":link: [$LINK]($LINK)" >> $GITHUB_STEP_SUMMARY
else
LINK="https://www.npmjs.com/package/@databricks/appkit-agent?activeTab=versions"
echo "## :test_tube: Package Released (next tag)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**@databricks/appkit-agent v$PKG_VERSION** has been published to npm with --tag next!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo ":link: [$LINK]($LINK)" >> $GITHUB_STEP_SUMMARY
fi
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ Pipfile
docs/build

**/uv.lock

node_modules/
Loading