Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.
Merged
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
53 changes: 27 additions & 26 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
name: PR Checks
name: Build Python Package

on:
push:
branches:
- main
pull_request:
branches: ["main"]
branches:
- main
release:
types:
- published

jobs:
test:
build-package:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13"]
environment:
name: pypi
url: https://pypi.org/p/stapi-fastapi
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pip
.venv
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Install
run: |
python -m pip install poetry==1.7.1
poetry install --with=dev
- name: Lint
python-version: "3.12"
- name: Install dependencies
run: |
poetry run pre-commit run --all-files
- name: Test
run: poetry run pytest
python -m pip install --upgrade pip
pip install build
pip install .
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags')