Skip to content

Commit b26707c

Browse files
committed
Update GitHub Actions workflows for building and deploying
1 parent 04b0b2c commit b26707c

File tree

2 files changed

+21
-74
lines changed

2 files changed

+21
-74
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/build_deploy.yml

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,31 @@
11
name: Build and upload to PyPI
22

33
on:
4-
workflow_dispatch:
54
release:
6-
types:
7-
- published
5+
types: [published]
86

9-
jobs:
10-
build_wheels:
11-
name: Build wheels on ${{ matrix.os }}
12-
runs-on: ${{ matrix.os }}
13-
strategy:
14-
matrix:
15-
# macos-13 is an intel runner, macos-14 is apple silicon
16-
os: [ubuntu-latest]
17-
18-
steps:
19-
- uses: actions/checkout@v4
7+
permissions:
8+
contents: read
209

21-
- name: Build wheels
22-
uses: pypa/[email protected]
23-
24-
- uses: actions/upload-artifact@v4
25-
with:
26-
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
27-
path: ./wheelhouse/*.whl
10+
jobs:
11+
deploy:
2812

29-
build_sdist:
30-
name: Build source distribution
3113
runs-on: ubuntu-latest
32-
steps:
33-
- uses: actions/checkout@v4
34-
35-
- name: Build sdist
36-
run: pipx run build --sdist
37-
38-
- uses: actions/upload-artifact@v4
39-
with:
40-
name: cibw-sdist
41-
path: dist/*.tar.gz
4214

43-
upload_pypi:
44-
needs: [build_wheels, build_sdist]
45-
runs-on: ubuntu-latest
46-
environment: pypi
47-
permissions:
48-
id-token: write
49-
if: github.event_name == 'release' && github.event.action == 'published'
5015
steps:
51-
- uses: actions/download-artifact@v4
52-
with:
53-
# unpacks all CIBW artifacts into dist/
54-
pattern: cibw-*
55-
path: dist
56-
merge-multiple: true
57-
58-
- uses: pypa/gh-action-pypi-publish@release/v1
59-
with:
60-
password: ${{ secrets.PYPI_API_TOKEN }}
16+
- uses: actions/checkout@v4
17+
- name: Set up Python
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install build
25+
- name: Build package
26+
run: python -m build
27+
- name: Publish package
28+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
29+
with:
30+
user: __token__
31+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)