Skip to content

Merge branch 'main' into fix/history-graph-branches #74

Merge branch 'main' into fix/history-graph-branches

Merge branch 'main' into fix/history-graph-branches #74

Workflow file for this run

name: Distribution
on:
push:
branches-ignore: [renovate/**]
tags: [ontokit-*]
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- run: uv sync --group dev
- run: uv run ruff check ontokit/
- run: uv run ruff format --check ontokit/
- run: uv run mypy ontokit/
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- run: uv sync --group dev
- run: uv run pytest tests/ -v --cov=ontokit
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- run: uv build
- run: uvx twine check --strict dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
publish_pypi:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/ontokit-')
needs: [lint, test, build]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: astral-sh/setup-uv@v4
- run: uv publish --trusted-publishing always
working-directory: dist
publish_github:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/ontokit-')
needs: [lint, test, build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: ncipollo/release-action@v1
with:
artifacts: dist/*
generateReleaseNotes: true
publish_docker:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/ontokit-')
needs: [lint, test]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/ontokit
tags: |
type=semver,pattern={{version}},value=${{ github.ref_name }},prefix=
type=semver,pattern={{major}}.{{minor}},value=${{ github.ref_name }},prefix=
type=raw,value=latest
- uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.prod
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max