CD #55
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
name: CD | |
on: | |
workflow_run: | |
workflows: CI | |
types: | |
- completed | |
branches: | |
- main | |
env: | |
PYTHON_VERSION: "3.10" | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
makedocs: | |
name: Deploy API Documentation | |
runs-on: ubuntu-latest | |
if: success() | |
steps: | |
- name: Get the docs_build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: docs_final | |
path: docs_build | |
run-id: ${{ github.event.workflow_run.id }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Display structure of docs | |
run: ls -R docs_build/ | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs_build | |
destination_dir: . # Ensure you deploy to the root of the gh-pages branch | |
publish_branch: gh-pages | |
keep_files: false | |
build-n-publish: | |
name: Build and publish Python ?? distributions ?? to TestPyPI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get history and tags for SCM versioning to work | |
run: | | |
git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install pypa/build | |
run: | | |
python -m pip install build twine | |
python -m pip install . | |
- name: Build a binary wheel and a source tarball | |
run: | | |
python -m build --sdist --wheel --outdir dist/ . | |
- name: Check Dist | |
run: | | |
python -m twine check dist/* | |
- name: Upload to Test PyPI | |
run: | | |
python -m twine upload -r testpypi -u __token__ -p ${{ secrets.TEST_PYPI_API }} dist/* |