-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (39 loc) · 1.15 KB
/
publish-to-pypi.yaml
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
name: Publish Python distributions to PyPI
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
build-and-publish:
name: Build and publish Python distributions 📦 to PyPI
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
env:
POETRY_VERSION: "1.7.1"
steps:
- uses: actions/checkout@v4
- name: Load cached Poetry installation
uses: actions/cache@v4
with:
path: ~/.local
key: ${{ runner.os }}-dotlocal-dir-py${{ matrix.python-version }}-poetry${{ env.POETRY_VERSION }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: poetry install
- name: Publish to PyPI
uses: celsiusnarhwal/poetry-publish@v2
with:
python-version: 3.11
token: ${{ secrets.PYPI_API_TOKEN }}
build: true
# repo: testpypi
# token: ${{ secrets.TEST_PYPI_API_TOKEN }}