-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (28 loc) · 861 Bytes
/
publish.yml
File metadata and controls
33 lines (28 loc) · 861 Bytes
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
name: Publish to PyPI
on:
workflow_dispatch:
permissions:
id-token: write # Required for OpenID Connect authentication
contents: read
jobs:
publish:
name: Publish Python Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: Gr1N/setup-poetry@v8
- uses: actions/cache@v4.2.3
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- run: poetry --version
- run: poetry install
- run: poetry build
- name: Publish to PyPI using Trusted Publisher
env:
POETRY_HTTP_BASIC_PYPI_USERNAME: __token__
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: poetry publish