Bump importlib-metadata from 5.0.0 to 8.0.0 #999
Workflow file for this run
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: Test, publish to PyPI and create Release. | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
tags: | |
- "*" | |
pull_request_target: | |
branches: | |
- master | |
- develop | |
jobs: | |
test: | |
environment: | |
name: Testing | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
include: | |
- os: ubuntu-latest | |
path: ~/.cache/pip | |
- os: macos-latest | |
path: ~/Library/Caches/pip | |
- os: windows-latest | |
path: ~\AppData\Local\pip\Cache | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache pip | |
uses: actions/cache@v4 | |
with: | |
path: ${{ matrix.path }} | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ matrix.python-version }} | |
- name: Update pip, wheel and setuptools | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install . | |
- name: Test with pytest | |
run: | | |
pytest tests/ --api_key ${{ secrets.CODEFORCES_API_KEY }} --api_secret ${{ secrets.CODEFORCES_API_SECRET }} -v | |
publish: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: test | |
name: Build and publish Python 🐍 distributions 📦 to PyPI | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Cache pip | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ matrix.python-version }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install requirements | |
run: | | |
python -m pip install pip wheel twine --upgrade | |
pip install -r requirements.txt | |
- name: Build a binary wheel and a source tarball | |
run: | | |
python setup.py sdist | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.pypi_password }} | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: publish | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Create Release | |
id: create_release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.event.head_commit.message }} | |
draft: false | |
prerelease: false |