-
Notifications
You must be signed in to change notification settings - Fork 100
37 lines (32 loc) · 1.04 KB
/
pypi.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
# thanks Justin Connor :-)
# see here for source: https://justinoconnor.codes/2021/05/02/automated-pypi-package-release-versioning-with-github/
name: Upload Python Package
on:
release:
types: [released]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
# remove qulacs from dependencies (issues with windows and mac)
# users need to install themselves if they want it
#cat requirements.txt | sed "s|qulacs|#qulacs|g" > tmp.txt
rm requirements.txt
mv tmp.txt requirements.txt
python setup.py sdist bdist_wheel
twine upload dist/*