Skip to content

Commit 82be4d6

Browse files
authored
Merge pull request #204 from danielward27/publishing
Attempt to fix publishing...
2 parents 60d83e2 + 0781699 commit 82be4d6

File tree

1 file changed

+49
-13
lines changed

1 file changed

+49
-13
lines changed

.github/workflows/publish.yml

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,68 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build-n-publish:
11-
name: Publish to TestPyPI and PyPI
10+
build:
11+
name: Build distribution
1212
runs-on: ubuntu-latest
13-
permissions:
14-
id-token: write # For pypi trusted publishing
15-
1613
steps:
1714
- uses: actions/checkout@v4
18-
1915
- name: Set up Python
2016
uses: actions/setup-python@v5
2117
with:
2218
python-version: "3.x"
2319

2420
- name: Install pypa/build
25-
run: python -m pip install build --user
26-
21+
run: python3 -m pip install build --user
2722
- name: Build a binary wheel and a source tarball
28-
run: python -m build --sdist --wheel --outdir dist/
23+
run: python3 -m build
24+
- name: Store the distribution packages
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: python-package-distributions
28+
path: dist/
29+
30+
publish-to-testpypi:
31+
name: Publish to TestPyPI
32+
needs:
33+
- build
34+
runs-on: ubuntu-latest
35+
36+
environment:
37+
name: testpypi
38+
url: https://test.pypi.org/p/flowjax
39+
40+
permissions:
41+
id-token: write # IMPORTANT: mandatory for trusted publishing
2942

30-
- name: Publish distribution to Test PyPI
43+
steps:
44+
- name: Download all the dists
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: python-package-distributions
48+
path: dist/
49+
- name: Publish distribution 📦 to TestPyPI
3150
uses: pypa/gh-action-pypi-publish@release/v1
3251
with:
3352
repository-url: https://test.pypi.org/legacy/
3453

35-
- name: Publish distribution to PyPI
36-
uses: pypa/gh-action-pypi-publish@release/v1
54+
publish-to-pypi:
55+
name: Publish Python distribution to PyPI
56+
needs:
57+
- publish-to-testpypi
58+
runs-on: ubuntu-latest
59+
60+
environment:
61+
name: pypi
62+
url: https://pypi.org/p/flowjax
63+
64+
permissions:
65+
id-token: write # IMPORTANT: mandatory for trusted publishing
66+
67+
steps:
68+
- name: Download all the dists
69+
uses: actions/download-artifact@v4
3770
with:
38-
attestations: false # Newly introduced and seems to cause errors
71+
name: python-package-distributions
72+
path: dist/
73+
- name: Publish distribution 📦 to PyPI
74+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)