Skip to content

v0.1.0

v0.1.0 #1

Workflow file for this run

name: Release
# On a published GitHub Release: gate on the full test suite (ci.yml), build the sdist +
# wheel, attach them to the Release, and (opt-in) publish to PyPI.
#
# vgi-python workers ship to PyPI, NOT as a compiled binary. PyPI upload uses Trusted
# Publishing (OIDC — no API tokens) and is GATED behind the repo variable PYPI_PUBLISH:
# it stays skipped until a maintainer sets `PYPI_PUBLISH=true` AND configures a Trusted
# Publisher on PyPI for the `vgi-wikipedia` project pointing at:
# owner: Query-farm · repo: vgi-wikipedia · workflow: release.yml · environment: pypi
# Until then the Release still ships installable sdist+wheel assets, CI-gated and green.
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
jobs:
ci:
uses: ./.github/workflows/ci.yml
build:
name: Build + attach distributions
needs: [ci]
runs-on: ubuntu-latest
permissions:
contents: write # attach assets to the Release
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Check version matches tag
if: github.event_name == 'release'
run: ci/check-version.sh "${{ github.event.release.tag_name }}"
- name: Build sdist + wheel
run: uv build --sdist --wheel --out-dir dist .
- name: Validate metadata
run: uvx twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
- name: Attach distributions to the Release
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${{ github.event.release.tag_name }}" dist/* --clobber
publish:
name: Publish to PyPI (opt-in)
needs: [build]
# Skipped until the maintainer enables PyPI Trusted Publishing (see header). A skipped
# job does not fail the workflow, so releases stay green before PyPI is configured.
if: ${{ vars.PYPI_PUBLISH == 'true' }}
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # required for Trusted Publishing
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1