piotrmaslanka #23
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-satella | |
run-name: ${{ github.actor }} | |
on: [ push ] | |
jobs: | |
prepare-system: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@main | |
- uses: actions/setup-python@main | |
with: | |
python-version: '$${{ matrix.version }}' | |
cache: 'pip' | |
- name: Install everything | |
run: pip install -e .[test,dev,extras] | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.6", "3.7", "3.8", "pypy3.9", "pypy3.10", "3.9", "3.10", "3.11", "3.12" ] | |
steps: | |
- uses: actions/checkout@main | |
- uses: actions/setup-python@main | |
with: | |
python-version: '${{ matrix.python-version }}' | |
cache: 'pip' | |
- name: Test everything | |
run: pytest -n 8 -vv --cov=satella | |
upload-coverage: | |
runs-on: "ubuntu-latest" | |
needs: ["tests"] | |
steps: | |
- uses: actions/setup-python@main | |
with: | |
python-version: '3.10' | |
- run: coverage xml | |
- uses: caffco/[email protected] | |
build-project: | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
python-version: [ "3.6", "3.7", "3.8", "pypy3.9", "pypy3.10", "3.9", "3.10", "3.11", "3.12" ] | |
steps: | |
- uses: actions/setup-python@main | |
name: Setup Python | |
with: | |
python-version: '$${{ matrix.version }}' | |
cache: 'pip' | |
- name: Alter Version | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
run: | | |
echo -e '__version__ = "' > satella/__init__.py | |
echo -e '${{ github.event.release.tag_name }}' >> satella/__init__.py | |
echo '"' >> satella/__init__.py | |
python -v | |
- name: Build | |
run: python -m build . | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@master | |
with: | |
name: builds | |
path: | | |
dist | |
send-to-pypi: | |
runs-on: "ubuntu-latest" | |
needs: ["build-project", "tests"] | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/setup-python@main | |
name: Setup Python | |
with: | |
python-version: '$${{ matrix.version }}' | |
cache: 'pip' | |
- name: Install Twine | |
run: pip install twine | |
- name: Download all builds artifacts | |
uses: actions/download-artifact@main | |
with: | |
name: builds | |
- name: Send over packages to PyPI | |
run: | | |
echo $PYPIRC_PASSWORD_DATA > ~/.pypirc | |
twine upload dist/* | |