Skip to content
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
63 changes: 63 additions & 0 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Publish to PyPI

on: workflow_dispatch

permissions:
actions: write

jobs:
build:
runs-on: ubuntu-latest

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

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: "1.8.5"

- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local

- name: Define a cache for the virtual environment based on the dependencies lock file
uses: actions/cache@v4
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}

- name: Build
run: poetry build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: csaps-packages
path: dist/*
overwrite: true

upload:
name: Upload to PyPI
needs: [ build ]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/csaps
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v4
with:
name: csaps-packages
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1