-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
18 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 |
---|---|---|
|
@@ -86,7 +86,16 @@ jobs: | |
cd: | ||
needs: ci | ||
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master') | ||
# Note: github.event.pull_request.draft == false WON'T WORK in "if" statement, | ||
# because the triggered event is a push, not a pull_request. | ||
# This means each commit will trigger a release on TestPyPI. | ||
# Those releases will only succeed when each push has a new version number: a1, a2, a3, etc. | ||
if: | | ||
github.event_name == 'push' && | ||
( | ||
startsWith(github.ref, 'refs/tags') || | ||
startsWith(github.ref, 'refs/heads/release-') | ||
) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -98,14 +107,16 @@ jobs: | |
run: | | ||
python -m pip install build --user | ||
python -m build --sdist --wheel --outdir dist/ . | ||
- name: Publish to TestPyPI | ||
- name: | | ||
Publish to TestPyPI when pushing to release-* branch. | ||
You better test with a1, a2, b1, b2 releases first. | ||
uses: pypa/[email protected] | ||
if: github.ref == 'refs/heads/master' | ||
if: startsWith(github.ref, 'refs/heads/release-') | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
- name: Publish to PyPI | ||
- name: Publish to PyPI when tagged | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/[email protected] | ||
with: | ||
|
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
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