Skip to content

chore(release): prepare axiam-python-sdk 1.0.0-alpha21 #11

chore(release): prepare axiam-python-sdk 1.0.0-alpha21

chore(release): prepare axiam-python-sdk 1.0.0-alpha21 #11

Workflow file for this run

name: Docs Publish
# Publishes the Python SDK's API reference (pdoc) to this repository's own
# GitHub Pages site, on each release tag.
#
# PyPI renders only the README — it does not host API reference docs — so the
# reference is generated here and deployed to the ROOT of the gh-pages branch
# (https://ilpanich.github.io/axiam-python-sdk/). In the monorepo this job
# deployed into a shared `sdk/python/` subtree alongside six sibling SDKs and
# needed keep_files: true so tagging one SDK could not delete another's docs.
# This repo owns its whole Pages site, so the deploy replaces the root outright.
on:
push:
tags:
- 'v*'
permissions:
contents: read
# gh-pages is a single branch: serialize deploys so two tags pushed together
# cannot race each other's commit.
concurrency:
group: docs-publish
cancel-in-progress: false
jobs:
# A release tag must be cut from main — same gate as the publish job in
# sdk-ci-python.yml.
verify-tag-on-main:
name: Verify tag is on main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Assert the tagged commit is an ancestor of origin/main
run: |
set -euo pipefail
git fetch --no-tags origin main
if ! git merge-base --is-ancestor "${GITHUB_SHA}" origin/main; then
echo "::error::Tag ${GITHUB_REF_NAME} is not on origin/main — refusing to publish docs."
exit 1
fi
echo "OK: ${GITHUB_REF_NAME} is on origin/main."
docs-python:
name: Python SDK docs (pdoc)
needs: verify-tag-on-main
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- name: Build API docs
run: |
set -euo pipefail
python -m pip install --upgrade pip
# pdoc IMPORTS the package to introspect it, so it must be installed
# for real — and with the framework extras, or importing
# axiam_sdk.fastapi / axiam_sdk.django raises ModuleNotFoundError.
pip install '.[fastapi,django]' pdoc
# The public subpackages must be named explicitly: pdoc only recurses
# into submodules re-exported from __init__, so a bare `pdoc axiam_sdk`
# silently documents the top-level module ALONE and drops the amqp,
# django and fastapi APIs.
pdoc axiam_sdk axiam_sdk.amqp axiam_sdk.django axiam_sdk.fastapi \
-o ./_docs_out
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_docs_out
commit_message: "docs: publish API docs for ${{ github.ref_name }}"