diff --git a/.github/workflows/pypi_upload.yml b/.github/workflows/pypi_upload.yml index 2d07aa6107..0244f26d2f 100644 --- a/.github/workflows/pypi_upload.yml +++ b/.github/workflows/pypi_upload.yml @@ -1,13 +1,13 @@ -name: Create Release & Upload To PyPI +name: Upload Python Package on: push: # Sequence of patterns matched against refs/tags tags: - - v?[0-9]+.[0-9]+.[0-9]+.?(a|b|rc|dev)?[0-9]+ # add .* to allow dev releases + - v[0-9]+.[0-9]+.* # add .* to allow dev releases jobs: - build: + deploy: name: pipenv PyPI Upload runs-on: ubuntu-latest env: @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v2 - uses: webfactory/ssh-agent@v0.1.1 with: @@ -37,14 +37,18 @@ jobs: with: python-version: 3.7 - - name: Install latest tools for build + - name: Install dependencies run: | - python -m pip install --upgrade --upgrade-strategy=eager pip setuptools wheel invoke + python -m pip install --upgrade --upgrade-strategy=eager pip setuptools wheel twine python -m pip install . python -m pipenv install --dev + env: + PIPENV_PYTHON: "3.7" + - name: Build wheels run: | - python -m pipenv runpython setup.py sdist bdist_wheel + python -m pipenv run python setup.py sdist bdist_wheel + # to upload to test pypi, pass repository_url: https://test.pypi.org/legacy/ and use secrets.TEST_PYPI_TOKEN - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@master @@ -53,6 +57,7 @@ jobs: password: ${{ secrets.TEST_PYPI_TOKEN }} repository_url: https://test.pypi.org/legacy/ packages_dir: dist/ + # git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:master # we need to use a deploy key for this to get around branch protection as the default token fails - name: Pre-bump @@ -61,3 +66,4 @@ jobs: git config --local user.email action@github.com python -m pipenv run inv release.bump-version --dev --commit git push git@github.com:${{ github.repository }}.git HEAD:master +