-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.11 KB
/
publish.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: Build & publish to PyPI
on:
workflow_dispatch:
jobs:
build:
name: Build package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry # see https://github.com/actions/setup-python/issues/369
run: curl -sSL https://install.python-poetry.org | python3 -
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "poetry"
- name: Install poetry and build
run: |
pip install poetry
poetry build
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: ./dist
publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: build
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: artifact/