Skip to content

Commit 28aa22e

Browse files
committed
Trusted publishing to pypi test
1 parent d78620d commit 28aa22e

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "Publish Python distribution to PyPI Test"
2+
# Uses:
3+
# https://github.com/actions/setup-python : 0b93645e9fea7318ecaed2b359559ac225c90a2b
4+
# https://github.com/actions/checkout : 11bd71901bbe5b1630ceea73d27597364c9af683
5+
# https://github.com/actions/download-artifact : fa0a91b85d4f404e444e00e005971372dc801d16
6+
# https://github.com/actions/upload-artifact : 6f51ac03b9356f520e9adb1b1b7802705f340c2b
7+
# https://github.com/actions/pypa/gh-action-pypi-publish : 76f52bc884231f62b9a034ebfe128415bbaabdfc
8+
9+
on:
10+
pull_request:
11+
12+
jobs:
13+
build:
14+
name: "Build test distribution"
15+
runs-on: "ubuntu-latest"
16+
17+
steps:
18+
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
19+
with:
20+
persist-credentials: false
21+
22+
- name: "Set up Python"
23+
uses: "actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b"
24+
with:
25+
python-version: "3.12"
26+
27+
- name: "Build the package"
28+
run: "python -m pip install nox; nox --session build"
29+
30+
- name: "Store the distribution packages"
31+
uses: "actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b"
32+
with:
33+
name: "python-package-distributions"
34+
path: "dist/"
35+
36+
publish-to-pypi:
37+
name: "Publish Python Distribution to PyPI Test"
38+
if: startsWith(github.ref, 'refs/tags/')
39+
needs: ["build"]
40+
runs-on: "ubuntu-latest"
41+
environment:
42+
name: "testpypi"
43+
url: "https://pypi.org/p/commented-configparser"
44+
permissions:
45+
id-token: "write"
46+
47+
steps:
48+
- name: "Download all the dists"
49+
uses: "actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16"
50+
with:
51+
name: "python-package-distributions"
52+
path: "dist/"
53+
54+
- name: "Publish distribution to PyPI"
55+
uses: "pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc"
56+
with:
57+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)