Skip to content

Commit

Permalink
Update deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mottosso committed Mar 20, 2021
1 parent 8c4c516 commit 3250538
Showing 1 changed file with 17 additions and 25 deletions.
42 changes: 17 additions & 25 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,24 @@ on:
tags:
- '*'

# From https://docs.github.com/en/actions/guides/building-and-testing-python
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
with:
python-version: '3.7'
architecture: 'x64'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python.version)"
displayName: "Use Python $(python.version)"

- name: Deploy
run: |
pip install wheel twine
python setup.py sdist bdist_wheel
echo [distutils] > ~/.pypirc
echo index-servers=pypi >> ~/.pypirc
echo [pypi] >> ~/.pypirc
echo username=$PYPI_USERNAME >> ~/.pypirc
echo password=$PYPI_PASSWORD >> ~/.pypirc
twine upload dist/*
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
- 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 setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

0 comments on commit 3250538

Please sign in to comment.