Skip to content

docling-metrics-core 0.14.0 #14

docling-metrics-core 0.14.0

docling-metrics-core 0.14.0 #14

Workflow file for this run

name: "Build and publish package"
on:
release:
types: [published]
permissions:
contents: read
jobs:
meta:
runs-on: ubuntu-latest
outputs:
package: ${{ steps.meta.outputs.package }}
is_native: ${{ steps.meta.outputs.is_native }}
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v6
- name: Identify package from tag
id: meta
run: |
TAG="${{ github.event.release.tag_name }}"
PKG="${TAG%-v*}"
echo "package=${PKG}" >> "$GITHUB_OUTPUT"
BUILD_BACKEND=$(uvx --from=toml-cli toml get --toml-path="packages/${PKG}/pyproject.toml" build-system.build-backend 2>/dev/null || echo "")
if [[ "$BUILD_BACKEND" == *"scikit_build_core"* ]]; then
echo "is_native=true" >> "$GITHUB_OUTPUT"
else
echo "is_native=false" >> "$GITHUB_OUTPUT"
fi
build-and-publish-pure:
if: needs.meta.outputs.is_native == 'false'
needs: [meta]
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v5
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install dependencies
run: uv sync --frozen --all-extras --all-packages -v
- name: Build
run: uv build --package ${{ needs.meta.outputs.package }}
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
build-native:
if: needs.meta.outputs.is_native == 'true'
needs: [meta]
uses: ./.github/workflows/wheels.yml
with:
package: ${{ needs.meta.outputs.package }}
publish-native:
name: Publish native package to PyPI
if: needs.meta.outputs.is_native == 'true'
needs: [meta, build-native]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/${{ needs.meta.outputs.package }}
permissions:
id-token: write
contents: write
steps:
- uses: actions/download-artifact@v5
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1