forked from openSUSE/libsolv
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (74 loc) · 2.44 KB
/
release-python.yml
File metadata and controls
89 lines (74 loc) · 2.44 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
---
name: Release to PyPI
on: workflow_dispatch
jobs:
build_sdist:
name: Build source package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.1
- name: Install/Upgrade dependencies
run: |
sudo apt install -y make cmake zlib1g-dev lbzip2 libxml2-dev lzma-dev swig
sudo apt install -y python3 python3-pip git
python3 -m pip install --upgrade pip scikit-build
python3 -m pip install --upgrade pip scikit-build
- name: Build and install Python source package
run: |
python3 setup.py sdist
python3 -m pip install dist/*.tar.gz
# - name: Run tests
# run: |
# pip install pytest
# pytest --verbose --color=yes test/
- uses: actions/upload-artifact@v6
with:
name: source
path: dist/*.tar.gz
build_bdist:
name: Build binary wheels
strategy:
matrix:
include:
- os: ubuntu-24.04
arch: x86_64
- os: ubuntu-24.04-arm
arch: aarch64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6.0.1
# setup Python for cibuildwheel
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Build wheels for CPython
uses: pypa/cibuildwheel@v3.3.1
env:
CIBW_ARCHS: auto64
CIBW_SKIP: "pp* *-musllinux_* cp36* cp37* cp38*" # no PyPy or musl builds, no older Python versions
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 # alma 8
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
CIBW_BEFORE_ALL: dnf install -y make cmake zlib-devel bzip2-devel libxml2-devel xz-devel swig
CIBW_BEFORE_BUILD: python -m pip install scikit-build
# CIBW_TEST_REQUIRES: pytest
# CIBW_TEST_COMMAND: pytest --verbose --color=yes {project}/test/
- uses: actions/upload-artifact@v6
with:
name: ${{ matrix.arch }}
path: ./wheelhouse/*.whl
upload_pypi:
name: Publish packages to PyPI
# only publish packages once everything is successful
needs: [build_bdist, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v6
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@v1.13.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# To test: repository_url: https://test.pypi.org/legacy/