forked from sepehrkrz/nwmurl
-
Notifications
You must be signed in to change notification settings - Fork 4
40 lines (32 loc) · 1023 Bytes
/
python-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
name: Publish nwmurl to PyPi
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: pip install setuptools wheel pytest python-dateutil
- name: Run pytest
run: pytest
- name: List Secrets
run: |
echo "Available secrets:"
env
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package if tests passed
if: success() # Only runs if the previous steps were successful
run: |
pip install twine==4.0.2
echo "PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}" # Print the API token for verification
twine upload -u '__token__' -p ${{ secrets.PYPI_API_TOKEN }} dist/*