fix(#868k5bbdr): Publish on push to master #6
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: CI | |
| on: | |
| push: | |
| env: | |
| BASE_VERSION: '6.0.0' | |
| jobs: | |
| checks: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 8 | |
| matrix: | |
| check: [bluecheck, doc8, docs, flake8, isortcheck, mypy, pylint, rstcheck] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install tox | |
| run: pip install tox | |
| - name: Run checks | |
| run: tox -e ${{ matrix.check }} | |
| tests: | |
| needs: checks | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install tox | |
| run: pip install tox | |
| - name: Run tests | |
| run: tox -e py | |
| publish: | |
| needs: tests | |
| if: github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Establish Versioning, Tags, and Labels | |
| id: vtl | |
| uses: mapped/action-vtl@latest | |
| with: | |
| baseVersion: ${{ env.BASE_VERSION }} | |
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Update package version | |
| run: | | |
| sed -i "s/__version__ = '.*'/__version__ = '${{ steps.vtl.outputs.ver_semVerNoMeta }}'/" diskcache/__init__.py | |
| - name: Build package | |
| run: | | |
| pip install build | |
| python -m build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |