Skip to content

CD

CD #133

Workflow file for this run

name: CD
on:
workflow_run:
workflows: CI
types:
- completed
branches:
- master
env:
PYTHON_VERSION: "3.10"
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# 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: 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
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install .[doc]
python -m pip install finufft
- name: Build API documentation
run: |
python -m sphinx docs docs_build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: 'docs_build'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
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/*