Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/prod-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Publish to PyPI

on:
release:
types: [published]

jobs:
validate-release:
name: Validate Release Across Python Versions
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
fail-fast: false

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: ${{ 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 project dependencies
run: |
pip install -r ci/requirements.txt
pip install .

- name: Run tests
run: pytest tests --cov solt --cov-report term-missing -v

- name: Check code formatting
run: black --config=black.toml --check .

- name: Run flake8 linter
run: flake8

build-and-publish:
name: Build and Publish to PyPI
runs-on: ubuntu-latest
needs: validate-release
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 distributions
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
41 changes: 41 additions & 0 deletions .github/workflows/update-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# .github/workflows/update-docs.yml

name: Build and Deploy Documentation

on:
push:
branches:
- master
paths:
- 'doc/**'

jobs:
build-deploy-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx
pip install .

- name: Build documentation
working-directory: doc
run: make html

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/_build/html
publish_branch: gh-pages
force_orphan: true