-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert python-publish changes from PR 132
- Loading branch information
1 parent
89a50e1
commit ed0e767
Showing
1 changed file
with
27 additions
and
26 deletions.
There are no files selected for viewing
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
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') |