-
Notifications
You must be signed in to change notification settings - Fork 639
40 lines (33 loc) · 1.02 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
name: PyPI Release
# https://help.github.com/en/actions/reference/events-that-trigger-workflows
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install poetry
shell: bash
run: |
curl -sSL https://install.python-poetry.org | python3 -
python -m pip install poetry-dynamic-versioning[plugin]
- name: Set poetry path variable
run: echo "/Users/runner/.local/bin" >> $GITHUB_PATH
- name: Build
run: |
poetry build
- name: Publish distribution 📦 to PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
run: |
poetry publish --username "${{ secrets.PYPI_USER }}" --password "${{ secrets.PYPI_PASSWORD }}"