Release 2.0.3 #24
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: Pypi publish 📦 | |
on: | |
release: | |
types: [published] | |
branches: | |
- master | |
jobs: | |
Package: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v2.3.4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python 🐍 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install Poetry | |
uses: snok/install-poetry@5e4414407e59f94f2148bcb253917dfc22dee7d9 | |
with: | |
virtualenvs-in-project: false | |
virtualenvs-path: ~/.cache/poetry/virtualenvs | |
- uses: actions/cache@v1 | |
name: Cache Poetry deps | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: pypi-${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | |
restore-keys: | | |
pypi-${{ runner.os }}-poetry- | |
- name: Config git | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
- name: Install Dependencies | |
run: poetry install -v --no-interaction | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: 📦 Build Python package and publish to PyPI 📦 | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
poetry version ${{ github.event.release.tag_name }} | |
poetry publish --build -u __token__ -p ${{ secrets.PYPI_TOKEN }} | |
- name: Add and commit changes | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
git add pyproject.toml | |
git commit -m "chore(release): release version ${{ github.event.release.tag_name }}" | |
- name: Push changes | |
uses: ad-m/github-push-action@40bf560936a8022e68a3c00e7d2abefaf01305a6 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build doc | |
run: POETRY=poetry make docs | |
- name: Publish doc | |
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./site |