Skip to content

Commit 93e0c20

Browse files
committed
add test.pypi repo to release
1 parent 2bb501b commit 93e0c20

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
##
2+
# Derived from:
3+
# https://github.com/django-commons/django-commons-playground/blob/main/.github/workflows/release.yml
4+
#
5+
16
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
27

38
on: push
49

510
env:
6-
# Change these for your project's URLs
711
PYPI_URL: https://pypi.org/p/django-typer
8-
# Eventually add back the test release, see example at
9-
# https://github.com/django-commons/django-commons-playground/blob/main/.github/workflows/release.yml
12+
PYPI_TEST_URL: https://test.pypi.org/project/django-typer
1013

1114
jobs:
1215

@@ -94,3 +97,28 @@ jobs:
9497
gh release upload
9598
'${{ github.ref_name }}' dist/**
9699
--repo '${{ github.repository }}'
100+
101+
publish-to-testpypi:
102+
name: Publish Python 🐍 distribution 📦 to TestPyPI
103+
needs:
104+
- build
105+
runs-on: ubuntu-latest
106+
107+
environment:
108+
name: testpypi
109+
url: ${{ env.PYPI_TEST_URL }}
110+
111+
permissions:
112+
id-token: write # IMPORTANT: mandatory for trusted publishing
113+
114+
steps:
115+
- name: Download all the dists
116+
uses: actions/download-artifact@v3
117+
with:
118+
name: python-package-distributions
119+
path: dist/
120+
- name: Publish distribution 📦 to TestPyPI
121+
uses: pypa/gh-action-pypi-publish@release/v1.10
122+
with:
123+
repository-url: https://test.pypi.org/legacy/
124+
skip-existing: true

0 commit comments

Comments
 (0)