Skip to content

Release 0.2.1

Release 0.2.1 #13

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [published]
jobs:
test-all:
name: Run Tests and Linting
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || github.sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install wheel and build tools
run: python -m pip install --upgrade wheel build
- name: Install PyTorch and dependencies
run: |
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install -r ci/requirements.txt
pip install . --no-deps
- name: Run tests
run: pytest tests --cov solt --cov-report=xml --junitxml=./junit.xml
- name: Check code formatting
run: black --config=black.toml --check .
- name: Run flake8 linter
run: flake8
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
build-and-publish:
name: Build and Publish to PyPI
runs-on: ubuntu-latest
needs: test-all
environment:
name: pypi
url: https://pypi.org/project/solt/
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade wheel build twine
- name: Build package
run: python -m build
- name: Validate built packages with twine
run: twine check dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: dist/
verbose: true