forked from bhargavchippada/forceatlas2
-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (94 loc) · 3.46 KB
/
Copy pathpython-publish.yml
File metadata and controls
110 lines (94 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Build and Publish Wheels
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
jobs:
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up QEMU for Linux ARM builds
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
pip install cibuildwheel==2.21.3
- name: Build wheels
env:
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*"
CIBW_SKIP: "pp* *-musllinux_*"
# Use manylinux_2_28 (AlmaLinux 8) to avoid CentOS 7 EOL issues
# These images have working repositories and include gcc by default
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64
CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/manylinux_2_28_aarch64
# Install dependencies - gcc is already available in manylinux_2_28 images
CIBW_BEFORE_BUILD: "python -m pip install --upgrade packaging setuptools>=75 wheel>=0.44 Cython>=3.0 numpy"
CIBW_BEFORE_BUILD_LINUX: "python -m pip install --upgrade packaging setuptools>=75 wheel>=0.44 Cython>=3.0 numpy"
CIBW_BEFORE_BUILD_WINDOWS: "python -m pip install --upgrade packaging setuptools>=75 wheel>=0.44 Cython>=3.0 numpy"
# Run actual test suite to verify wheels work correctly on each platform
CIBW_TEST_COMMAND: 'pytest {project}/tests -v -m "not slow" --tb=short'
CIBW_TEST_REQUIRES: "pytest numpy scipy tqdm networkx python-igraph matplotlib"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_ARCHS_LINUX: "x86_64 aarch64"
CIBW_BUILD_VERBOSITY: 1
run: |
python -m cibuildwheel --output-dir wheelhouse
- name: Build sdist (source)
if: matrix.os == 'ubuntu-latest'
run: |
python -m pip install --upgrade packaging build setuptools wheel Cython
python -m build --sdist --outdir wheelhouse
- name: List built wheels
shell: bash
run: ls -lh wheelhouse/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: wheelhouse/*
if-no-files-found: error
publish:
name: Publish to PyPI
needs: build-wheels
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/fa2-modified
permissions:
id-token: write
contents: read
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: List all files to publish
shell: bash
run: ls -lh dist/
- name: Verify wheels
run: |
python -m pip install --upgrade packaging twine pkginfo readme_renderer
twine check dist/*
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN_GITHUB }}
packages-dir: dist
verbose: true
print-hash: true