forked from powsybl/pypowsybl
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (124 loc) · 4.07 KB
/
release-ci.yml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Release
on:
release:
types:
- created
- released
permissions:
contents: write
jobs:
manylinux_build:
name: Build linux ${{ matrix.python.name }} wheel
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux_2_28_x86_64:2024-11-16-d70d8cd
strategy:
matrix:
python:
- {
name: cp38,
abi: cp38,
version: '3.8',
}
steps:
- name: Install Linux Packages
run: dnf install -y wget
- name: Install Maven
run: |
wget https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz -P /tmp
tar xf /tmp/apache-maven-*.tar.gz -C /opt
echo /opt/apache-maven-3.9.6/bin >> $GITHUB_PATH
- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '17.0.12'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: true
- name: Setup path
run: echo "/opt/python/${{ matrix.python.name }}-${{ matrix.python.abi }}/bin/" >> $GITHUB_PATH
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Build wheel
run: |
python3 setup.py bdist_wheel
auditwheel repair dist/*.whl
- name: Install wheel
run: pip3 install wheelhouse/*.whl --user
- name: Run basic pypowsybl import
working-directory: ./tests
run: python3 basic_import_test.py
- name: Upload binaries
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dist/binaries.zip
asset_name: binaries-${{ github.event.release.tag_name }}-linux.zip
asset_content_type: application/zip
macos_windows_build:
name: Build ${{ matrix.config.name }} ${{ matrix.python.name }} wheel
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {
name: darwin,
os: macos-13,
}
- {
name: darwin-arm64,
os: macos-14,
macosx_deployment_target: "11", # first arm64 version of macosx
bdist_wheel_args: "--plat-name macosx-11.0-arm64", # needed to avoid the wheel to be named -universal2
}
- {
name: windows,
os: windows-2022,
}
python:
- {
name: cp38,
version: '3.8',
}
steps:
- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '17.0.12'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python.version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Build wheel
env:
MACOSX_DEPLOYMENT_TARGET: "10.16" # to ensure pip finds wheel when Big Sur is configured to return 10.16 as version instead of 11.0
run: python setup.py bdist_wheel
- name: Install wheel
shell: bash
run: python -m pip install dist/*.whl --user
- name: Run basic pypowsybl import
working-directory: ./tests
run: python3 basic_import_test.py
- name: Upload binaries
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dist/binaries.zip
asset_name: binaries-${{ github.event.release.tag_name }}-${{ matrix.config.name }}.zip
asset_content_type: application/zip