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
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test-python:
name: Test Python Package
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

defaults:
run:
working-directory: packages/llmpane-py

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[all]"

- name: Run linting
run: ruff check llmpane

- name: Run type checking
run: mypy llmpane

- name: Run tests
run: pytest -v

test-react:
name: Test React Package
runs-on: ubuntu-latest

defaults:
run:
working-directory: packages/llmpane-react

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: packages/llmpane-react/package-lock.json

- name: Install dependencies
run: npm ci

- name: Run linting
run: npm run lint

- name: Run tests
run: npm run test:run

- name: Build package
run: npm run build
136 changes: 136 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Publish React Package

on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "npm tag (latest, beta, next)"
required: false
default: "latest"
type: choice
options:
- latest
- beta
- next
dry_run:
description: "Dry run (no actual publish)"
required: false
default: false
type: boolean

jobs:
build:
name: Build Package
runs-on: ubuntu-latest

defaults:
run:
working-directory: packages/llmpane-react

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: packages/llmpane-react/package-lock.json

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: npm-package
path: |
packages/llmpane-react/dist/
packages/llmpane-react/package.json
packages/llmpane-react/README.md

test:
name: Test Package
runs-on: ubuntu-latest
needs: build

defaults:
run:
working-directory: packages/llmpane-react

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: packages/llmpane-react/package-lock.json

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test:run

publish:
name: Publish to npm
runs-on: ubuntu-latest
needs: [build, test]
environment: npm
permissions:
contents: read
id-token: write

defaults:
run:
working-directory: packages/llmpane-react

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
cache: "npm"
cache-dependency-path: packages/llmpane-react/package-lock.json

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Determine npm tag
id: npm-tag
run: |
if [ "${{ github.event_name }}" == "release" ]; then
# Check if it's a prerelease
if [ "${{ github.event.release.prerelease }}" == "true" ]; then
echo "tag=beta" >> $GITHUB_OUTPUT
else
echo "tag=latest" >> $GITHUB_OUTPUT
fi
else
echo "tag=${{ inputs.tag }}" >> $GITHUB_OUTPUT
fi

- name: Publish to npm (dry run)
if: inputs.dry_run
run: npm publish --access public --tag ${{ steps.npm-tag.outputs.tag }} --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to npm
if: "!inputs.dry_run"
run: npm publish --access public --tag ${{ steps.npm-tag.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
108 changes: 108 additions & 0 deletions .github/workflows/publish-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Publish Python Package

on:
release:
types: [published]
workflow_dispatch:
inputs:
test_pypi:
description: "Publish to TestPyPI instead of PyPI"
required: false
default: false
type: boolean

jobs:
build:
name: Build Package
runs-on: ubuntu-latest

defaults:
run:
working-directory: packages/llmpane-py

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build

- name: Build package
run: python -m build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: python-package
path: packages/llmpane-py/dist/

test:
name: Test Package
runs-on: ubuntu-latest
needs: build

defaults:
run:
working-directory: packages/llmpane-py

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[all]"

- name: Run tests
run: pytest -v

publish-testpypi:
name: Publish to TestPyPI
runs-on: ubuntu-latest
needs: [build, test]
if: github.event_name == 'workflow_dispatch' && inputs.test_pypi
environment: testpypi
permissions:
id-token: write

steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: python-package
path: dist/

- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

publish-pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build, test]
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && !inputs.test_pypi)
environment: pypi
permissions:
id-token: write

steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: python-package
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,6 @@ cython_debug/
marimo/_static/
marimo/_lsp/
__marimo__/

# Claude
.claude
Loading