-
Notifications
You must be signed in to change notification settings - Fork 7
45 lines (38 loc) · 1.15 KB
/
pypi_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
41
42
43
44
name: Build, publish, and deploy with Poetry (on release)
on:
workflow_dispatch: {}
release:
types: [published]
jobs:
build_and_publish:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Install dependencies
run: poetry install
- name: Build package
run:
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry build
- name: Publish package to PyPI (if release)
if: github.event_name == 'release'
# env:
# PYPI_USERNAME: __token__
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: poetry publish
- name: Deploy source code
if: github.event_name == 'release'
uses: actions/upload-artifact@v2
with:
name: source-code-${{ matrix.python-version }}
path: .