-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (37 loc) · 1.04 KB
/
pypi-publication.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
38
39
40
41
42
name: Publish package to pypi
on:
pull_request:
branches: [pypi-publish]
push:
branches: [main]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
environment: release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: python -m pip install --upgrade pip twine build poetry
- name: Poetry single source of truth tag add on
run: poetry self add poetry-version-plugin
- name: Setup virtual environment
run: poetry install
- name: Build distributable package
run: poetry build
- name: Check distributable
run: twine check --strict dist/*.whl
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
password: ${{ secrets.PYPI_API_TOKEN }}