fix: Path.walk not supported in Python < 3.12 #37 #5
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: Publish python package to PyPi | |
on: | |
push: | |
branches: | |
- master | |
- main | |
permissions: | |
contents: write | |
jobs: | |
build-python-package: | |
name: Build distribution packages | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Install dependencies and build distribution packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
python setup.py sdist bdist_wheel | |
twine check dist/* | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
publish-to-pypi: | |
name: Publish Python distribution package to PyPI | |
if: ${{ github.repository == 'quantorconsulting/mkdocs_build_plantuml' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }} | |
needs: | |
- build-python-package | |
runs-on: ubuntu-latest | |
environment: | |
name: pipy | |
url: https://pypi.org/p/mkdocs-build-plantuml-plugin | |
permissions: | |
id-token: write | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution packages to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
add-git-tag: | |
name: Add version tag to repository | |
needs: | |
- publish-to-pypi | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get version from VERSION file | |
id: get_version | |
run: | | |
echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT | |
- name: Create and push tag | |
run: | | |
git tag ${{ steps.get_version.outputs.version }} | |
git push origin ${{ steps.get_version.outputs.version }} |