Skip to content

Commit

Permalink
CI: publish on release event (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
elacuesta authored Apr 21, 2021
1 parent c2ccb28 commit 07e07c1
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
name: Publish
on: [push]
on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2

- name: Set up Python 2
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: 2

- name: Check Tag
id: check-release-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+[.][0-9]+[.][0-9]+(rc[0-9]+|[.]dev[0-9]+)?$ ]]; then
echo ::set-output name=release_tag::true
fi
python-version: 3

- name: Publish to PyPI
if: steps.check-release-tag.outputs.release_tag == 'true'
run: |
pip install --upgrade pip
pip install --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
export TWINE_USERNAME=__token__
Expand Down

0 comments on commit 07e07c1

Please sign in to comment.