-
Notifications
You must be signed in to change notification settings - Fork 9
54 lines (38 loc) · 1.32 KB
/
pypi-publish.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
45
46
47
48
49
50
51
52
53
54
name: PyPI publishing
on:
push:
create:
jobs:
pypi_publish:
name: Publish to PyPI
runs-on: ubuntu-latest
strategy:
fail-fast: true
if: contains(github.ref, 'refs/tags/')
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: sh bin/cicd_install.sh
- name: Build package
run: poetry build
- name: Validate built wheel
run: sh bin/cd_validate_build.sh
#################################################
# publish to Test PyPI for validation purposes
- name: Configure Test Pypi
run: poetry config repositories.testpypi https://test.pypi.org/legacy/
- name: Publish to Test PyPI
env:
TEST_PYPI_TOKEN: ${{ secrets.PARSENVY_TEST_PYPI }}
run: poetry publish -r testpypi -u __token__ -p "$TEST_PYPI_TOKEN"
#################################################
# publish to production PyPI
- name: Publish to production PyPI
env:
PRODUCTION_PYPI_TOKEN: ${{ secrets.PARSENVY_PRODUCTION_PYPI }}
run: poetry publish -u __token__ -p "$PRODUCTION_PYPI_TOKEN"