Skip to content

Commit 34398a8

Browse files
authored
Merge pull request #5 from danielward27/fix_publishing
Update workflow (try to fix publishing)
2 parents 7b4e4e6 + 4800cd8 commit 34398a8

1 file changed

Lines changed: 29 additions & 15 deletions

File tree

.github/workflows/publish.yml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,49 @@
1-
name: Publish to TestPyPI and PyPI
1+
name: Publish to PyPI
22

33
on:
44
# Triggers the workflow when a release is created or edited.
55
release:
66
types: [created]
77

88
jobs:
9-
build-n-publish:
10-
name: Publish to TestPyPI and PyPI
9+
build:
10+
name: Build distribution
1111
runs-on: ubuntu-latest
12-
permissions:
13-
id-token: write # For pypi trusted publishing
14-
1512
steps:
1613
- uses: actions/checkout@v4
17-
1814
- name: Set up Python
1915
uses: actions/setup-python@v5
2016
with:
2117
python-version: "3.x"
2218

2319
- name: Install pypa/build
24-
run: python -m pip install build --user
25-
20+
run: python3 -m pip install build --user
2621
- name: Build a binary wheel and a source tarball
27-
run: python -m build --sdist --wheel --outdir dist/
28-
29-
- name: Publish distribution to Test PyPI
30-
uses: pypa/gh-action-pypi-publish@release/v1
22+
run: python3 -m build
23+
- name: Store the distribution packages
24+
uses: actions/upload-artifact@v4
3125
with:
32-
repository-url: https://test.pypi.org/legacy/
26+
name: python-package-distributions
27+
path: dist/
3328

34-
- name: Publish distribution to PyPI
29+
publish-to-pypi:
30+
name: Publish to PyPI
31+
needs:
32+
- build
33+
runs-on: ubuntu-latest
34+
35+
environment:
36+
name: pypi
37+
url: https://pypi.org/p/paramax
38+
39+
permissions:
40+
id-token: write # Mandatory for trusted publishing
41+
42+
steps:
43+
- name: Download all the dists
44+
uses: actions/download-artifact@v4
45+
with:
46+
name: python-package-distributions
47+
path: dist/
48+
- name: Publish distribution 📦 to PyPI
3549
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)