Skip to content

Commit 4a29674

Browse files
authored
Automate publishing upon release
Add publish.yml to workflows, which uses poetry to build and publish package when a release is created.
1 parent 33c95f7 commit 4a29674

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This workflows will upload a Python Package using Poetry when a release is created
2+
name: Upload Python Package
3+
4+
on:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.8
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
poetry export -f requirements.txt --output requirements.txt
21+
pip install -r requirements.txt
22+
- name: Build and publish
23+
env:
24+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
25+
run: poetry publish --build

0 commit comments

Comments
 (0)