Skip to content

Commit 3e6027d

Browse files
committed
improving GitHub publish workflow
1 parent 83f695b commit 3e6027d

File tree

5 files changed

+414
-324
lines changed

5 files changed

+414
-324
lines changed

.github/workflows/python-publish.yml

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ jobs:
4444
runs-on: ${{ matrix.os }}
4545
strategy:
4646
matrix:
47-
# os: [ubuntu-latest, windows-latest, macos-13, macos-14]
48-
os: [windows-latest, macos-13]
47+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
4948

5049
steps:
5150
- uses: actions/checkout@v4
@@ -61,31 +60,31 @@ jobs:
6160
name: dist-wheels-${{ matrix.os }}-${{ strategy.job-index }}
6261
path: dist/*.whl
6362

64-
# pypi-publish:
65-
# runs-on: ubuntu-latest
66-
# needs:
67-
# - release-build-sdist
68-
# - release-build-wheels
69-
# permissions:
70-
# # IMPORTANT: this permission is mandatory for trusted publishing
71-
# id-token: write
72-
#
73-
# environment:
74-
# name: pypi
75-
# url: https://pypi.org/p/compiled-knowledge
76-
#
77-
# steps:
78-
# - name: Retrieve release distributions
79-
# uses: actions/download-artifact@v4
80-
# with:
81-
# pattern: dist-*
82-
# path: dist/
83-
# merge-multiple: true
84-
#
85-
# - name: Publish release distributions to PyPI
86-
# uses: pypa/gh-action-pypi-publish@release/v1
87-
# with:
88-
# packages-dir: dist/
63+
pypi-publish:
64+
runs-on: ubuntu-latest
65+
needs:
66+
- release-build-sdist
67+
- release-build-wheels
68+
permissions:
69+
# IMPORTANT: this permission is mandatory for trusted publishing
70+
id-token: write
71+
72+
environment:
73+
name: pypi
74+
url: https://pypi.org/p/compiled-knowledge
75+
76+
steps:
77+
- name: Retrieve release distributions
78+
uses: actions/download-artifact@v4
79+
with:
80+
pattern: dist-*
81+
path: dist/
82+
merge-multiple: true
83+
84+
- name: Publish release distributions to PyPI
85+
uses: pypa/gh-action-pypi-publish@release/v1
86+
with:
87+
packages-dir: dist/
8988

9089
testpypi-publish:
9190
runs-on: ubuntu-latest

RELEASING.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,27 @@ Prepare for the release
1515

1616
Only proceed if the "main" branch is ready for release.
1717

18-
Perform the release
19-
-------------------
18+
Perform the release - GitHub action
19+
-----------------------------------
20+
21+
1. Commit and push the "main" branch.
22+
This will automatically release the documentation.
23+
2. Go to the project [GitHub Actions, Upload Python Package](https://github.com/ropeless/compiled_knowledge/actions/workflows/python-publish.yml).
24+
3. Select "Run workflow".
25+
26+
Perform the release - manual
27+
----------------------------
28+
29+
This manual release process will only upload wheels for the platform that
30+
these commands are run on.
2031

2132
1. Commit and push the "main" branch.
2233
This will automatically release the documentation.
2334
2. Ensure you are on an up-to-date checkout of the "main" branch.
2435
3. Delete any existing project `dist` directory.
25-
4. Build the package using: `python setup.py sdist bdist_wheel`.
26-
5. Upload the package to PyPI using: `python -m twine upload dist/*`.
36+
4. Build the source distribution using: `python setup.py sdist`.
37+
5. Build the binary distribution using: `cibuildwheel --output-dir dist`.
38+
6. Upload the package to PyPI using: `python -m twine upload dist/*`.
2739

2840

2941
Post-release checks

docs/1_introduction.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"* toml,\n",
6565
"* setuptools,\n",
6666
"* build,\n",
67+
"* cibuildwheel,\n",
6768
"* twine,\n",
6869
"* coverage.\n",
6970
"\n",

0 commit comments

Comments
 (0)