v8.3.1 #55
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 | |
on: | |
release: | |
types: [published] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2.4.0 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4.3.0 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
cache-dependency-path: "pyproject.toml" | |
- name: Install uv | |
run: | | |
pip install --upgrade pip | |
pip install uv | |
- name: Activate virtualenv | |
run: | | |
uv venv | |
. .venv/bin/activate | |
echo PATH=$PATH >> $GITHUB_ENV | |
- name: Install python dependencies | |
run: | | |
uv pip install -e .[strict,tests] | |
- name: Build a binary wheel and a source tarball | |
run: | | |
python -m build --sdist --wheel --outdir dist/ . | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@v1.5.1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPY_API_TOKEN }} | |
docs: | |
runs-on: ubuntu-latest | |
needs: | |
- deploy | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install pandoc | |
run: sudo apt-get install pandoc | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4.3.0 | |
with: | |
python-version: "3.11" | |
- name: Install uv | |
run: | | |
pip install --upgrade pip | |
pip install uv | |
- name: Activate virtualenv | |
run: | | |
uv venv | |
. .venv/bin/activate | |
echo PATH=$PATH >> $GITHUB_ENV | |
- name: Install python dependencies | |
run: | | |
uv pip install -e .[strict,docs] | |
uv pip install auto-changelog | |
- name: Generate changelog | |
run: | | |
auto-changelog -u --tag-prefix "v" | |
- name: Commit files | |
env: | |
CI_USER: ${{ secrets.YOUR_GITHUB_USER }} | |
CI_EMAIL: ${{ secrets.YOUR_GITHUB_EMAIL }} | |
run: | | |
git config --local user.email "$CI_EMAIL" | |
git config --local user.name "$CI_USER" | |
git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo "push=true" >> $GITHUB_ENV || echo "No changes to CHANGELOG.md" | |
- name: Push changes | |
if: env.push == 'true' | |
env: | |
CI_USER: ${{ secrets.YOUR_GITHUB_USER }} | |
CI_TOKEN: ${{ secrets.GITHUB_TOKEN}} | |
run: | | |
git push "https://$CI_USER:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:main | |
- name: Build | |
run: sphinx-build docs docs_build | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3.9.3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs_build |