Skip to content

use gh-action-pypi push #10

use gh-action-pypi push

use gh-action-pypi push #10

name: Publish Python Package
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for trusted publishing
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run Tests
run: poetry run pytest
- name: Build the package
if: success()
run: poetry build
- name: Publish to PyPI
if: success()
uses: pypa/gh-action-pypi-publish@release/v1