Skip to content

Commit 756203c

Browse files
authored
Merge pull request #351 from CITCOM-project/f-allian/chore
update: publish-to-pypi.yaml
2 parents 29ab701 + ad50cfb commit 756203c

File tree

1 file changed

+12
-73
lines changed

1 file changed

+12
-73
lines changed

.github/workflows/publish-to-pypi.yaml

Lines changed: 12 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -6,88 +6,27 @@ on:
66
- v*
77

88
jobs:
9-
# First job is to build the wheels on different OS
10-
build_wheels:
11-
name: Build wheels on ${{ matrix.os }}
12-
runs-on: ${{ matrix.os }}
13-
strategy:
14-
matrix:
15-
os: [ubuntu-latest, windows-latest, macos-latest]
16-
steps:
17-
- uses: actions/checkout@v3
18-
19-
- name: Set up Python
20-
uses: actions/setup-python@v4
21-
with:
22-
python-version: "3.12"
23-
24-
- name: Upgrade pip and install cibuildwheel
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install cibuildwheel
28-
29-
- name: Build wheels
30-
run: python -m cibuildwheel --output-dir wheelhouse
31-
env:
32-
CIBW_BUILD: "cp310-* cp311-* cp312-*"
33-
CIBW_SKIP: "pp* *musllinux*"
34-
CIBW_TEST_SKIP: "*"
35-
CIBW_ARCHS_MACOS: "universal2"
36-
CIBW_ARCHS_LINUX: "x86_64 aarch64"
37-
38-
- name: Upload built wheels
39-
uses: actions/upload-artifact@v4
40-
with:
41-
name: wheels-${{ matrix.os }}
42-
path: wheelhouse/*.whl
43-
44-
# Then just build the source distribution as normal
45-
build_sdist:
46-
name: Build source distribution
9+
build-release:
10+
name: Build and publish PyPI
4711
runs-on: ubuntu-latest
4812
steps:
4913
- uses: actions/checkout@v3
50-
14+
with:
15+
fetch-depth: 0
5116
- name: Set up Python
52-
uses: actions/setup-python@v4
17+
uses: actions/setup-python@v3
5318
with:
54-
python-version: "3.12"
19+
python-version: '3.10'
5520

56-
- name: Upgrade pip and install build
21+
- name: Install build tools
5722
run: |
58-
python -m pip install --upgrade pip
59-
pip install build
60-
61-
- name: Build sdist
62-
run: python -m build --sdist --outdir dist
63-
64-
- name: Upload sdist
65-
uses: actions/upload-artifact@v4
66-
with:
67-
name: sdist
68-
path: dist/*.tar.gz
69-
70-
# Finally publish all files to PyPI
71-
publish:
72-
name: Publish to PyPI
73-
needs: [build_wheels, build_sdist]
74-
runs-on: ubuntu-latest
75-
steps:
76-
- uses: actions/checkout@v3
77-
78-
- name: Download all artifacts
79-
uses: actions/download-artifact@v4
80-
with:
81-
path: dist
23+
pip install --upgrade pip setuptools wheel build setuptools_scm
8224
83-
- name: Merge all distributions
25+
- name: Build Package
8426
run: |
85-
mkdir -p final_dist
86-
find dist -name '*.whl' -exec cp {} final_dist/ \;
87-
find dist -name '*.tar.gz' -exec cp {} final_dist/ \;
27+
python -m build --no-isolation
8828
89-
- name: Publish to PyPI
29+
- name: Publish package to PyPI
9030
uses: pypa/gh-action-pypi-publish@release/v1
9131
with:
92-
password: ${{ secrets.PYPI_API_TOKEN }}
93-
packages_dir: final_dist
32+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)