Skip to content

Commit 8c24b79

Browse files
authored
Update publish-to-test-pypi.yml
1 parent f93299d commit 8c24b79

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,50 @@
11
name: Publish Python distribution to PyPI and TestPyPI
22
on: push
3+
jobs:
4+
build:
5+
name: Build distribution 📦
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Set up Python
11+
uses: actions/setup-python@v5
12+
with:
13+
python-version: "3.x"
14+
- name: Install pypa/build
15+
run: >-
16+
python3 -m
17+
pip install
18+
build
19+
--user
20+
- name: Build a binary wheel and a source tarball
21+
run: python3 -m build
22+
- name: Store the distribution packages
23+
uses: actions/upload-artifact@v3
24+
with:
25+
name: python-package-distributions
26+
path: dist/
27+
28+
publish-to-testpypi:
29+
name: Publish Python distribution to TestPyPI, requires manual approval
30+
needs:
31+
- build
32+
runs-on: ubuntu-latest
33+
34+
environment:
35+
name: testpypi
36+
url: https://test.pypi.org/p/jam.py-v5-test
37+
38+
permissions:
39+
id-token: write # IMPORTANT: mandatory for trusted publishing
40+
41+
steps:
42+
- name: Download all the dists
43+
uses: actions/download-artifact@v3
44+
with:
45+
name: python-package-distributions
46+
path: dist/
47+
- name: Publish distribution to TestPyPI
48+
uses: pypa/gh-action-pypi-publish@release/v1
49+
with:
50+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)