Skip to content

Commit 258855b

Browse files
authored
Merge pull request #25 from PDBeurope/fix-gh-workflow
Updated GH workflow
2 parents f495a5b + 9558608 commit 258855b

File tree

1 file changed

+38
-27
lines changed

1 file changed

+38
-27
lines changed

.github/workflows/python-publish.yml

+38-27
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,46 @@ permissions:
1818

1919
jobs:
2020
build:
21+
name: Build distribution
2122
runs-on: ubuntu-latest
23+
2224
steps:
23-
- uses: actions/checkout@v3
24-
- name: Set up Python
25-
uses: actions/setup-python@v3
26-
with:
27-
python-version: "3.10"
28-
- name: Install dependencies
29-
run: |
30-
python -m pip install --upgrade pip
31-
pip install build
32-
- name: Build package
33-
run: python -m build
34-
- name: Archive the package
35-
uses: actions/upload-artifact@v4
36-
with:
37-
name: dist
38-
path: dist
39-
deploy:
25+
- uses: actions/checkout@v4
26+
- name: Set up Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: "3.10"
30+
- name: Install pypa/build
31+
run: >-
32+
python3 -m
33+
pip install
34+
build
35+
--user
36+
- name: Build a binary wheel and a source tarball
37+
run: python3 -m build
38+
- name: Store the distribution packages
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: python-package-distributions
42+
path: dist/
43+
44+
publish-to-pypi:
45+
name: >-
46+
Publish Python distribution to PyPI
47+
needs:
48+
- build
4049
runs-on: ubuntu-latest
50+
environment:
51+
name: pypi
52+
url: https://pypi.org/project/pdbe-arpeggio
4153
permissions:
42-
id-token: write
43-
needs: build
54+
id-token: write # IMPORTANT: mandatory for trusted publishing
55+
4456
steps:
45-
- name: Download artifact
46-
uses: actions/download-artifact@v4
47-
with:
48-
name: dist
49-
- name: Publish package
50-
uses: pypa/gh-action-pypi-publish@release/v1
51-
with:
52-
repository-url: https://upload.pypi.org/legacy/
57+
- name: Download all the dists
58+
uses: actions/download-artifact@v3
59+
with:
60+
name: python-package-distributions
61+
path: dist/
62+
- name: Publish distribution to PyPI
63+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)