-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Distinct TestPyPI and PyPI deploy jobs (#5)
Failure on TestPyPI impacted the run of the PyPI job.
- Loading branch information
Showing
1 changed file
with
23 additions
and
6 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 |
---|---|---|
|
@@ -31,11 +31,10 @@ jobs: | |
|
||
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | ||
build-publish: | ||
name: Build and publish Python distributions to TestPyPI and PyPI | ||
name: Publish Python distributions to TestPyPI | ||
runs-on: ubuntu-latest | ||
needs: run-tests # only run when tests where successful | ||
continue-on-error: true | ||
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags') | ||
if: github.ref == 'refs/heads/master' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -49,13 +48,31 @@ jobs: | |
- name: Build a binary wheel and a source tarball | ||
run: | | ||
python -m build --sdist --wheel --outdir dist/ . | ||
- name: Publish distribution 📦 to Test PyPI | ||
- name: Publish distribution to TestPyPI | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
|
||
build-publish-tags: | ||
name: Publish Python distributions to PyPI | ||
runs-on: ubuntu-latest | ||
needs: run-tests # only run when tests where successful | ||
if: startsWith(github.ref, 'refs/tags') | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install pypa/build | ||
run: | | ||
python -m pip install build --user | ||
- name: Build a binary wheel and a source tarball | ||
run: | | ||
python -m build --sdist --wheel --outdir dist/ . | ||
- name: Publish distribution to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |