-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.05 KB
/
release.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
name: Publish to PyPI
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
environment: PROD
steps:
- uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v4
# see details (matrix, python-version, python-version-file, etc.)
# https://github.com/actions/setup-python
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Prepare local environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define cache
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: poetry install
- name: Build package
run: |
poetry build
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry publish --username __token__ --password $POETRY_PYPI_TOKEN