-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dan Ryan <[email protected]>
- Loading branch information
1 parent
cac14da
commit 4e7b6e6
Showing
1 changed file
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
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: | ||
CI: "1" | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
uses: actions/checkout@v2 | ||
|
||
- uses: webfactory/[email protected] | ||
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 [email protected] | ||
python -m pipenv run inv release.bump-version --dev --commit | ||
git push [email protected]:${{ github.repository }}.git HEAD:master | ||