MilesCranmer commited on
Commit
c4a6ced
1 Parent(s): bdc71b3

Update GH workflow to push to pypi

Browse files
.github/workflows/python-publish.yml CHANGED
@@ -4,8 +4,8 @@
4
  name: Upload Python Package
5
 
6
  on:
7
- release:
8
- types: [created]
9
 
10
  jobs:
11
  deploy:
@@ -18,14 +18,13 @@ jobs:
18
  uses: actions/setup-python@v2
19
  with:
20
  python-version: '3.x'
21
- - name: Install dependencies
22
- run: |
23
- python -m pip install --upgrade pip
24
- pip install setuptools wheel twine
25
  - name: Build and publish
 
26
  env:
27
  TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28
  TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29
  run: |
 
 
30
  python setup.py sdist bdist_wheel
31
  twine upload dist/*
 
4
  name: Upload Python Package
5
 
6
  on:
7
+ push:
8
+ branches: master
9
 
10
  jobs:
11
  deploy:
 
18
  uses: actions/setup-python@v2
19
  with:
20
  python-version: '3.x'
 
 
 
 
21
  - name: Build and publish
22
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
23
  env:
24
  TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
25
  TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
26
  run: |
27
+ python -m pip install --upgrade pip
28
+ pip install setuptools wheel twine
29
  python setup.py sdist bdist_wheel
30
  twine upload dist/*