Skip to content

Commit b392035

Browse files
committed
updates for pypi release #2
1 parent ecd6f73 commit b392035

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/pypi_release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package to PyPI
10+
11+
env:
12+
PYTHON_MAIN_VERSION: 3.10
13+
POETRY_VERSION: 1.2.2
14+
15+
on:
16+
release:
17+
types: [published]
18+
19+
jobs:
20+
deploy:
21+
name: Test on ${{ matrix.os}}
22+
runs-on: ${{ matrix.os}}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os: [ubuntu-latest]
27+
python-version: ['3.7', '3.8', '3.9', '3.10']
28+
steps:
29+
- uses: actions/checkout@v3
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v3
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install poetry==${{ env.POETRY_VERSION }}
38+
poetry install
39+
40+
- name: Build Python package and Upload to TestPyPi
41+
env:
42+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
43+
run: |
44+
poetry update
45+
poetry build
46+
poetry publish -r testpypi --username "__token__" --password $PYPI_TOKEN

0 commit comments

Comments
 (0)