Skip to content

Commit 45a0aee

Browse files
committed
Ship release- branch of a non-draft PR to TestPyPI
1 parent cb4aa61 commit 45a0aee

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/python-package.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ jobs:
6565
6666
cd:
6767
needs: ci
68-
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/main')
68+
if: |
69+
github.event_name == 'push' &&
70+
(
71+
startsWith(github.ref, 'refs/tags') ||
72+
startsWith(github.ref, 'refs/heads/release-')
73+
)
6974
runs-on: ubuntu-latest
7075
steps:
7176
- uses: actions/checkout@v2
@@ -77,14 +82,16 @@ jobs:
7782
run: |
7883
python -m pip install build --user
7984
python -m build --sdist --wheel --outdir dist/ .
80-
- name: Publish to TestPyPI
85+
- name: |
86+
Publish to TestPyPI when pushing to release-* branch.
87+
You better test with a1, a2, b1, b2 releases first.
8188
uses: pypa/gh-action-pypi-publish@v1.4.2
82-
if: github.ref == 'refs/heads/main'
89+
if: startsWith(github.ref, 'refs/heads/release-')
8390
with:
8491
user: __token__
8592
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
8693
repository_url: https://test.pypi.org/legacy/
87-
- name: Publish to PyPI
94+
- name: Publish to PyPI when tagged
8895
if: startsWith(github.ref, 'refs/tags')
8996
uses: pypa/gh-action-pypi-publish@v1.4.2
9097
with:

0 commit comments

Comments
 (0)