Skip to content

Commit 3251ef8

Browse files
Fix pypi CI (#4)
* Use cibuildwheels * Add building sdist to CI * Add mac os to CI * Use trusted publisher * Fix typo
1 parent 40b772f commit 3251ef8

3 files changed

Lines changed: 42 additions & 20 deletions

File tree

.github/workflows/build.yml

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,31 @@ jobs:
1616

1717
- name: Check version numbers
1818
run: ./version.sh
19-
19+
20+
make_sdist:
21+
name: Make SDist
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
submodules: true
27+
28+
- name: Build SDist
29+
run: pipx run build --sdist
30+
31+
- uses: actions/upload-artifact@v4
32+
with:
33+
name: cibw-sdist
34+
path: dist/*.tar.gz
35+
2036
package-python:
2137
strategy:
2238
fail-fast: false
2339
matrix:
2440
os:
2541
- ubuntu-latest
42+
- macos-13
43+
- macos-latest
2644

2745
runs-on: ${{ matrix.os }}
2846

@@ -32,42 +50,37 @@ jobs:
3250
with:
3351
submodules: 'true'
3452

35-
- name: Upgrade pip and build
36-
run: |
37-
python3 -m pip install --upgrade pip
38-
python3 -m pip install --upgrade build
53+
- name: Build wheels
54+
uses: pypa/cibuildwheel@v2.22.0
3955

40-
- name: Build wheel
41-
run: python3 -m build
42-
4356
- name: Upload binary wheel
4457
uses: actions/upload-artifact@v4
4558
with:
46-
name: dist
47-
path: ./dist/*.whl
59+
name: cibw-wheels-${{ matrix.os }}
60+
path: ./wheelhouse/*.whl
4861

4962
deploy:
63+
environment:
64+
name: pypi
65+
url: https://pypi.org/p/libbash
5066
needs:
5167
- check-version-numbers
5268
- package-python
69+
permissions:
70+
id-token: write
5371
runs-on: ubuntu-latest
5472
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')
5573

5674
steps:
5775
- name: Download distributions
5876
uses: actions/download-artifact@v4
77+
with:
78+
path: dist
79+
pattern: cibw-*
80+
merge-multiple: true
5981

6082
- name: Deploy test distribution to Test PyPI
6183
uses: pypa/gh-action-pypi-publish@release/v1
6284
with:
63-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
64-
verbose: true
65-
repository_url: https://test.pypi.org/legacy/
66-
skip_existing: true
67-
68-
- name: Deploy tagged release on PyPI
69-
if: startsWith(github.ref, 'refs/tags')
70-
uses: pypa/gh-action-pypi-publish@release/v1
71-
with:
72-
password: ${{ secrets.PYPI_API_TOKEN }}
7385
verbose: true
86+
skip_existing: true

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os:
18+
- ubuntu-20.04 # earliest pash supports currently
1819
- ubuntu-latest
20+
- macos-13
21+
- macos-latest
1922
runs-on: ${{ matrix.os }}
2023
if: github.event.pull_request.draft == false
2124
steps:

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ Issues = "https://github.com/binpash/libbash/issues"
2222
[build-system]
2323
requires = ["setuptools>=61.0"]
2424
build-backend = "setuptools.build_meta"
25+
26+
[tool.cibuildwheel.macos]
27+
# doesn't work for some reason
28+
# shouldn't be necessary since bash has no
29+
# dependencies besides libc (checked on linux with audit wheel)
30+
repair-wheel-command = ""

0 commit comments

Comments
 (0)