Update github actions

This commit is contained in:
Yiorgis Gozadinos 2025-11-04 18:37:01 +02:00
parent 44ad5bf101
commit ce79f8e037
No known key found for this signature in database
4 changed files with 34 additions and 12 deletions

View file

@ -0,0 +1,18 @@
name: Build & publish haiku.rag-slim to pypi
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.3.0/install.sh | sh
- name: Set up Python 3.12
run: uv python install 3.12
- name: Build haiku.rag-slim
run: uv build --package haiku.rag-slim
- name: Publish haiku.rag-slim
run: uvx twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/* --non-interactive

View file

@ -1,18 +1,22 @@
name: Build & publish to pypi
name: Build & publish haiku.rag to pypi
on:
release:
types: [published]
workflow_run:
workflows: ["Build & publish haiku.rag-slim to pypi"]
types:
- completed
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.3.0/install.sh | sh
- name: Set up Python 3.10
run: uv python install 3.10
- name: Build package
run: uvx --from build pyproject-build --installer uv
- name: Publish package
- name: Set up Python 3.12
run: uv python install 3.12
- name: Build haiku.rag
run: uv build
- name: Publish haiku.rag
run: uvx twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/* --non-interactive

View file

@ -1,7 +1,7 @@
name: Build & publish Docker image
on:
workflow_run:
workflows: ["Build & publish to pypi"]
workflows: ["Build & publish haiku.rag to pypi"]
types:
- completed
workflow_dispatch:
@ -40,7 +40,7 @@ jobs:
- name: Extract version from pyproject.toml
id: version
run: |
VERSION=$(grep -oP '^version = "\K[^"]+' pyproject.toml)
VERSION=$(grep -oP '^version = "\K[^"]+' haiku_rag_slim/pyproject.toml)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build and push Docker image

View file

@ -2,7 +2,7 @@ name: Publish to MCP Registry
on:
workflow_dispatch:
workflow_run:
workflows: ["Build & publish to pypi"]
workflows: ["Build & publish haiku.rag to pypi"]
types:
- completed
@ -21,7 +21,7 @@ jobs:
python-version: '3.12'
- name: Generate server.json from template
run: |
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
VERSION=$(python -c "import tomllib; print(tomllib.load(open('haiku_rag_slim/pyproject.toml', 'rb'))['project']['version'])")
sed "s/{{VERSION}}/$VERSION/g" server.json > server.json.tmp
mv server.json.tmp server.json
echo "Generated server.json with version: $VERSION"