Repository navigation
90 lines (74 loc) · 2.32 KB
/
Copy pathpython-publish.yml
File metadata and controls
90 lines (74 loc) · 2.32 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
name: Upload Python Package
on:
push:
release:
types: [published]
jobs:
build_wheels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build wheels
uses: pypa/cibuildwheel@v4.1.0
env:
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-*
CIBW_ARCHS_LINUX: x86_64
CIBW_BEFORE_ALL_LINUX: |
set -e
if command -v dnf >/dev/null 2>&1; then
dnf install -y cmake python3-devel
dnf install -y java-11-openjdk-devel graphviz tree || true
elif command -v yum >/dev/null 2>&1; then
yum install -y cmake python3-devel
yum install -y java-11-openjdk-devel graphviz tree || true
elif command -v apt-get >/dev/null 2>&1; then
apt-get update && apt-get install -y cmake python3-dev
apt-get install -y openjdk-11-jdk graphviz tree || true
elif command -v apk >/dev/null 2>&1; then
apk add --no-cache cmake python3-dev
apk add --no-cache openjdk11 graphviz tree || true
else
echo "No supported package manager found!" >&2
exit 1
fi
CIBW_BEFORE_BUILD_LINUX: |
set -e
python -m pip install --upgrade pip setuptools wheel cmake
- uses: actions/upload-artifact@v7
with:
name: wheels
path: ./wheelhouse/*.whl
build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Install system dependencies (Ubuntu)
run: sudo apt-get install -y tree graphviz openjdk-11-jdk cmake
- name: Build sdist
run: python -m build --sdist
- uses: actions/upload-artifact@v7
with:
name: sdist
path: dist/*.tar.gz
publish:
if: github.event_name == 'release'
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
pattern: "*"
path: dist/
merge-multiple: true
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1