Skip to content

Commit

Permalink
👷 Add Action for publishing to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
agmangas committed Sep 24, 2024
1 parent 848f03b commit a411d98
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and publish Python package to PyPI

on:
push:
branches:
- main

env:
PYPI_PROJECT_NAME: moderate-matrix-profile
PYTHON_VERSION: "3.11"
POETRY_VERSION: "1.8.3"

jobs:
build-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/${{ env.PYPI_PROJECT_NAME }}
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Poetry install & build
run: |
poetry install
poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1
with:
skip-existing: true
packages-dir: dist/
verbose: true

0 comments on commit a411d98

Please sign in to comment.