-
Notifications
You must be signed in to change notification settings - Fork 3
35 lines (31 loc) · 1.19 KB
/
publish-to-pypi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
name: Build and Publish to PyPI
on:
push:
# Pattern matched against refs/tags
tags:
- '*' # Push events to every tag not containing /
jobs:
build-and-publish:
name: Build and Publish to PyPI
runs-on: ubuntu-latest
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout git repository
uses: actions/checkout@v4
# https://github.com/marketplace/actions/setup-python
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
# Build ####################################################################
# https://github.com/marketplace/actions/publish-python-poetry-package
- name: Publish to PyPI
# https://github.com/JRubics/poetry-publish/issues/39
uses: JRubics/[email protected]
with:
# https://pypi.org/manage/account/token/
# https://github.com/<owner>/<repo>/settings/secrets/actions/new
pypi_token: ${{ secrets.PYPI_API_TOKEN }}
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')