-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (48 loc) · 1.32 KB
/
publish.yml
File metadata and controls
60 lines (48 loc) · 1.32 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Publish to PyPI
on:
release:
types: [created]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Upgrade pip and setuptools
run: |
python -m pip install --upgrade pip setuptools
- name: Install pipx
run: |
python -m pip install --upgrade pipx
- name: Install Poetry using pipx
run: |
pipx install poetry
- name: Configure Poetry
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
- name: Regenerate lock file if needed
run: |
set -e
if poetry check; then
echo "Dependencies are consistent"
else
echo "Regenerating lock file..."
poetry lock
fi
- name: Install dependencies
run: poetry install --only main
- name: Install dependencies (including dev)
run: poetry install --with dev
- name: Run tests
run: poetry run pytest
- name: Build and publish
env:
POETRY_HTTP_BASIC_PYPI_USERNAME: __token__
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
poetry build
poetry publish