From 32505380bbb91c4b5c32f6598c1d6fd1996a4719 Mon Sep 17 00:00:00 2001 From: Marcus Ottosson Date: Sat, 20 Mar 2021 20:02:19 +0000 Subject: [PATCH] Update deployment workflow --- .github/workflows/deploy.yml | 42 +++++++++++++++--------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index dbca7e2..68da50f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 }} \ No newline at end of file + - 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/*