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

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
python:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]

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 uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Install dependencies
working-directory: python
run: |
uv pip install --system -e ".[dev]"

- name: Run tests
working-directory: python
run: |
pytest tests/ -v --cov=jentic.problem_details --cov-report=term-missing

typescript:
name: TypeScript
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
working-directory: typescript
run: npm ci

- name: Build
working-directory: typescript
run: npm run build

- name: Run tests
working-directory: typescript
run: npm test

- name: Type check
working-directory: typescript
run: npm run typecheck
132 changes: 132 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., 1.0.0)'
required: true
type: string

concurrency: release

jobs:
release:
name: Release packages
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
environment:
name: npm-release
url: https://www.npmjs.com/org/jentic
permissions:
contents: write
id-token: write # Required for PyPI OIDC and NPM provenance

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'

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

- name: Update Python package version
working-directory: python
run: |
sed -i 's/^version = .*/version = "${{ inputs.version }}"/' pyproject.toml

- name: Update TypeScript package version
Comment thread
char0n marked this conversation as resolved.
working-directory: typescript
run: |
npm version ${{ inputs.version }} --no-git-tag-version

- name: Commit version changes and create tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add python/pyproject.toml typescript/package.json typescript/package-lock.json
git commit -m "chore: release v${{ inputs.version }}"
git tag -a "v${{ inputs.version }}" -m "Release v${{ inputs.version }}"
git push origin main --tags

- name: Install Python dependencies and build
working-directory: python
run: |
uv pip install --system build
python -m build

- name: Build TypeScript package
working-directory: typescript
run: |
npm ci
npm run build

- name: Prepare release artifacts
run: |
mkdir -p release-assets
cp python/dist/* release-assets/

echo "📦 Release artifacts:"
ls -la release-assets/

- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "🚀 Creating GitHub release..."
VERSION="${{ inputs.version }}"

# Try to extract changelog for this version
CHANGELOG_CONTENT="$(sed -n '/^## v'$VERSION'/,/^## /p' CHANGELOG.md 2>/dev/null | sed '$d')"

if [ -z "$CHANGELOG_CONTENT" ]; then
CHANGELOG_CONTENT="Release v$VERSION"
fi

gh release create "v$VERSION" \
--title "v$VERSION" \
--notes "$CHANGELOG_CONTENT" \
release-assets/*

- name: Publish Python package to PyPI
id: pypi_publish
continue-on-error: true # TODO: Remove after Trusted Publisher is configured on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: python/dist/
attestations: false

- name: Publish TypeScript package to NPM
id: npm_publish
working-directory: typescript
run: npm publish --access public --provenance

- name: Release Summary
run: |
echo "🎉 RELEASE COMPLETED"
echo "Released version: ${{ inputs.version }}"
echo ""
if [ "${{ steps.pypi_publish.outcome }}" == "success" ]; then
echo "Published to PyPI: ✓"
else
echo "Published to PyPI: ⚠️ SKIPPED (Trusted Publisher not configured yet)"
fi
echo "Published to NPM: ✓"
echo "GitHub release created: ✓"
71 changes: 71 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Virtual environments
venv/
ENV/
env/
.venv/

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/
coverage/
.hypothesis/

# TypeScript/JavaScript
node_modules/
dist/
*.tsbuildinfo
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# IDEs
.vscode/
.idea/
*.swp
*.swo
*.sublime-project
*.sublime-workspace

# OS
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Type checking
.mypy_cache/
.dmypy.json
dmypy.json
.pytype/

# Build outputs
*.log
Loading
Loading