Skip to content

Commit

Permalink
Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Anze committed Dec 12, 2019
1 parent dfe21d1 commit cfdd025
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/on_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy to PyPi

on:
release:
types: [published]

jobs:

build:
runs-on: ubuntu-latest
steps:

- name: Checkout source code
uses: actions/checkout@v1


- name: Use Python 3
uses: actions/setup-python@v1
with:
python-version: '3.6'
architecture: 'x64'


- name: Deploy to PyPi
if: success() && startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_REF_TAG: ${{ github.ref }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
export VERSION=${GITHUB_REF_TAG:10:50}
echo "Version is $VERSION"
pip install --no-cache-dir twine pipenv wheel
sed -i "s/@@VERSION@@/$CI_COMMIT_TAG/g" ./setup.py
pipenv lock -r > requirements.txt
python setup.py install
python setup.py sdist
python setup.py bdist_wheel
twine upload -r pypi -u __token__ -p "${PYPI_TOKEN}" dist/*

0 comments on commit cfdd025

Please sign in to comment.