Bump version v1.0.1 #17
Workflow file for this run
This file contains hidden or 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: test | |
| on: [push] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install python v${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -r tests/requirements.txt | |
| sudo apt update && sudo apt install ffmpeg -y | |
| - name: Run Tests | |
| run: | | |
| python -m unittest discover | |
| # see https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | |
| build: | |
| name: Build distribution 📦 | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') # only build on tag pushes | |
| needs: | |
| - test | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Check version | |
| run: | | |
| TAG_VERSION=${GITHUB_REF#refs/tags/v} | |
| PACKAGE_VERSION=$(grep -Po 'version\s*=\s*["\x27]\K[^"\x27]+' setup.py) | |
| if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then | |
| echo "Version mismatch! GitHub tag is $TAG_VERSION but package version is $PACKAGE_VERSION." | |
| exit 1 | |
| fi | |
| - name: Install pypa/build | |
| run: >- | |
| python3 -m | |
| pip install | |
| build | |
| --user | |
| - name: Build a binary wheel and a source tarball | |
| run: python3 -m build | |
| - name: Store the distribution packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| release: | |
| name: >- | |
| Publish Python 🐍 distribution 📦 to PyPI and Github | |
| if: startsWith(github.ref, 'refs/tags/v') # only publish on version tag pushes | |
| needs: | |
| - build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish distribution 📦 to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.DF3D_PYPI_API_TOKEN }} | |
| - name: Make Github release | |
| uses: softprops/action-gh-release@v2 |