release deployment #26
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
name: release deployment | |
on: | |
release: | |
types: | |
- created | |
tags: | |
- '*.*.*' | |
jobs: | |
check: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check version in setup.py | |
run: | | |
TAG_REF=(${GITHUB_REF//\// }) | |
TAG_REF=`echo "${TAG_REF[2]}" | tr -d '[:space:]'` | |
SETUP_PY_VERSION=`cat VERSION` | |
if [ "$SETUP_PY_VERSION" != "$TAG_REF" ]; then | |
echo "ERROR: setup.py contains version '$SETUP_PY_VERSION' which differs from '$TAG_REF'" | |
exit 1 | |
fi | |
deploy: | |
needs: check | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
- name: Build and publish | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
python setup.py sdist bdist_wheel | |
twine upload dist/* | |
deploy-doc: | |
needs: deploy | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git Credentials | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-mkdocs.txt | |
pip install setuptools wheel twine | |
- name: Build and publish | |
run: | | |
VERSION=$(cat VERSION) | |
mike deploy --push --update-aliases "$VERSION" latest |