-
Notifications
You must be signed in to change notification settings - Fork 23
37 lines (36 loc) · 1.04 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
36
37
# workflow automates the Python package publishing process
# to PyPI upon pushes to the main branch or manual triggers,
# incrementing version if needed.
name: Publish to PyPI
on:
push:
branches:
- main
paths-ignore:
- '**.md' # Ignore changes to Markdown files to prevent infinite loop
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
if: github.actor != 'github-actions[bot]' # This line prevents the loop
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: re run poetry lockfile
run: poetry lock --no-update
- name: Install project dependencies
run: poetry install
- name: Build package
run: poetry build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}