Verify README examples, release to PyPI #19
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: Verify README examples, release to PyPI | |
on: | |
push: | |
branches: [ "main" ] | |
tags: [ "v**" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Verify README examples | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: pip | |
cache-dependency-path: 'requirements*.txt' | |
- name: Install dvc-utils | |
run: pip install -e . -r requirements-ci.txt | |
- name: Verify README examples | |
env: | |
# Evaluate README examples from within the `test/data` submodule | |
BMDF_WORKDIR: test/data | |
run: | | |
mdcmd | |
git diff --exit-code | |
release: | |
name: Release to PyPI | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Install release deps | |
run: pip install utz[setup] twine wheel | |
- name: Install dvc-utils | |
run: pip install -e . | |
- name: Build release | |
run: python setup.py sdist bdist_wheel | |
- name: Publish release | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: twine upload dist/* |