Skip to content

Commit a6da931

Browse files
committed
fixing pypi publish
1 parent ccc9dae commit a6da931

File tree

2 files changed

+42
-8
lines changed

2 files changed

+42
-8
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish to PyPI
2+
on: push
3+
jobs:
4+
build-n-publish:
5+
name: Build and publish Python 🐍 distributions πŸ“¦ to PyPI
6+
runs-on: ubuntu-latest
7+
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/main'
8+
permissions:
9+
id-token: write
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@master
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Set up Python 3.10
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.10"
20+
21+
- name: Install pypa/build
22+
run: |
23+
pip install build --user
24+
pip install .
25+
- name: Install pypa/pdoc
26+
run: >-
27+
python -m
28+
pip install
29+
.[dev]
30+
--user
31+
- name: Generate documentation with pdoc
32+
run: python -m pdoc -o docs -n pysmart_exporter
33+
34+
- name: Build the binary wheel and source tarball
35+
run: python -m build --sdist --wheel --outdir dist/
36+
37+
- name: Publish distribution πŸ“¦ to PyPI
38+
uses: pypa/gh-action-pypi-publish@release/v1
39+
with:
40+
skip-existing: true

β€Ž.github/workflows/publish-to-test-pypi.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI
1+
name: Publish to TestPyPI
22
on: push
33
jobs:
44
build-n-publish:
5-
name: Build and publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI
5+
name: Build and publish Python 🐍 distributions πŸ“¦ to TestPyPI
66
runs-on: ubuntu-latest
77
permissions:
88
id-token: write
@@ -38,9 +38,3 @@ jobs:
3838
with:
3939
repository-url: https://test.pypi.org/legacy/
4040
skip-existing: true
41-
42-
- name: Publish distribution πŸ“¦ to PyPI
43-
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master'
44-
uses: pypa/gh-action-pypi-publish@release/v1
45-
with:
46-
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
Β (0)