Test publish docs and wheel - do not use #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will upload a Python Package using a release environment and a trusted publisher. | |
# See PyPi management in the datatrails confluence service for an explanation. | |
# | |
# Create a trusted publisher for datatrails-python in pypi.org and delete any API tokens. | |
# In github add an environment called release that is restricted to the main branch and | |
# delete any PYPI secrets. | |
name: Package and Publish | |
on: | |
release: | |
types: [created] | |
jobs: | |
deploy: | |
environment: release | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: write # This is required for actions/checkout and actions-gh-pages | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
export DEBIAN_FRONTEND=noninteractive | |
# https://github.com/community/community/discussions/47863 | |
sudo apt-mark hold grub-efi-amd64-signed | |
sudo apt-get update | |
sudo apt-get upgrade -y --no-install-recommends | |
sudo apt-get install -y --fix-missing \ | |
nodejs \ | |
libenchant-2-2 \ | |
pandoc \ | |
zip | |
sudo apt-get autoremove | |
sudo apt-get autoclean | |
sudo apt-get clean | |
sudo rm -rf /var/lib/apt/lists/* | |
python3 -m pip install --upgrade pip | |
python3 -m pip install -r requirements-dev.txt | |
python3 -m pip install setuptools wheel | |
shell: bash | |
- name: Create wheel | |
run: | | |
rm -f archivist/about.py | |
./scripts/version.sh | |
python3 -m build --sdist | |
python3 -m build --wheel | |
shell: bash | |
- name: Publish to PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
verbose: true | |
attestations: true | |
- name: Build docs | |
run: | | |
./scripts/zipnotebooks.sh | |
(cd docs && make clean && make html) | |
shell: bash | |
- name: Publish docs | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: "./docs/_build/html" | |
cname: python.datatrails.ai |