Release version v0.0.2 #11
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: Build package, run test matrix, and publish on PyPi | |
env: | |
BUILD_PYTHON_VERSION: "3.7" | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ env.BUILD_PYTHON_VERSION }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.BUILD_PYTHON_VERSION }} | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Build packages | |
run: | | |
python -m build | |
shasum dist/* | |
- name: Upload dist | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download dist | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pytest dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
- name: Install built packages | |
run: | | |
pip install -U dist/*.whl | |
- name: Test with pytest | |
run: | | |
pytest | |
pypi-publish: | |
needs: test | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/trick17 | |
permissions: | |
id-token: write | |
steps: | |
- name: Download dist | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |