Skip to content

Add PyPI release job #199

Add PyPI release job

Add PyPI release job #199

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
# 17:00 on Friday (UTC)
- cron: "00 17 * * 5"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
fail-fast: False
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make ci-install
- name: Lint with flake8
run: |
make flake8
- name: Lint with mypy
run: |
make mypy
- name: Test with pytest
run: |
make pytest
pypi-release:
needs: [build]
name: PyPI Release
environment: pypi
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- id: dist
run: |
make ci-install-build-system
python -m build .
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: Publish Package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1