Skip to content

Commit cea3ef9

Browse files
committed
improving GitHub publish workflow
1 parent c02f5ef commit cea3ef9

File tree

1 file changed

+51
-49
lines changed

1 file changed

+51
-49
lines changed

.github/workflows/python-publish.yml

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,34 @@ permissions:
1717
contents: read
1818

1919
jobs:
20-
# release-build-sdist:
21-
# runs-on: ubuntu-latest
22-
#
23-
# steps:
24-
# - uses: actions/checkout@v4
25-
#
26-
# - uses: actions/setup-python@v5
27-
# with:
28-
# python-version: "3.12"
29-
#
30-
# - name: Build source distribution
31-
# run: |
32-
# python -m ensurepip --upgrade
33-
# python -m pip install setuptools numpy cython
34-
# python setup.py sdist
35-
#
36-
# - name: Upload distributions
37-
# uses: actions/upload-artifact@v4
38-
# with:
39-
# name: release-dists
40-
# path: dist
20+
release-build-sdist:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.12"
29+
30+
- name: Build source distribution
31+
run: |
32+
python -m ensurepip --upgrade
33+
python -m pip install setuptools numpy cython
34+
python setup.py sdist
35+
36+
- name: Upload distributions
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: release-dists
40+
path: dist
4141

4242
release-build-wheels:
4343
name: Build wheels on ${{ matrix.os }}
4444
runs-on: ${{ matrix.os }}
4545
strategy:
4646
matrix:
47-
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
47+
os: [ubuntu-latest, windows-latest, macos-latest]
4848

4949
steps:
5050
- uses: actions/checkout@v4
@@ -63,7 +63,8 @@ jobs:
6363
# pypi-publish:
6464
# runs-on: ubuntu-latest
6565
# needs:
66-
# - release-build
66+
# - release-build-sdist
67+
# - release-build-wheels
6768
# permissions:
6869
# # IMPORTANT: this permission is mandatory for trusted publishing
6970
# id-token: write
@@ -86,29 +87,30 @@ jobs:
8687
# with:
8788
# packages-dir: dist/
8889

89-
# testpypi-publish:
90-
# runs-on: ubuntu-latest
91-
# needs:
92-
# - release-build
93-
# permissions:
94-
# # IMPORTANT: this permission is mandatory for trusted publishing
95-
# id-token: write
96-
#
97-
# # Dedicated environments with protections for publishing are strongly recommended.
98-
# # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
99-
# environment:
100-
# name: testpypi
101-
# url: https://test.pypi.org/p/compiled-knowledge
102-
#
103-
# steps:
104-
# - name: Retrieve release distributions
105-
# uses: actions/download-artifact@v4
106-
# with:
107-
# name: release-dists
108-
# path: dist/
109-
#
110-
# - name: Publish release distributions to TestPyPI
111-
# uses: pypa/gh-action-pypi-publish@release/v1
112-
# with:
113-
# repository-url: https://test.pypi.org/legacy/
114-
# packages-dir: dist/
90+
testpypi-publish:
91+
runs-on: ubuntu-latest
92+
needs:
93+
- release-build-sdist
94+
- release-build-wheels
95+
permissions:
96+
# IMPORTANT: this permission is mandatory for trusted publishing
97+
id-token: write
98+
99+
# Dedicated environments with protections for publishing are strongly recommended.
100+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
101+
environment:
102+
name: testpypi
103+
url: https://test.pypi.org/p/compiled-knowledge
104+
105+
steps:
106+
- name: Retrieve release distributions
107+
uses: actions/download-artifact@v4
108+
with:
109+
name: release-dists
110+
path: dist/
111+
112+
- name: Publish release distributions to TestPyPI
113+
uses: pypa/gh-action-pypi-publish@release/v1
114+
with:
115+
repository-url: https://test.pypi.org/legacy/
116+
packages-dir: dist/

0 commit comments

Comments
 (0)