77# nor does it submit to any jurisdiction.
88
99
10+ name : Build Python Wheel for Linux
11+
1012name : Build Linux
1113
1214on :
1618 # Allow to be called from another workflow
1719 workflow_call : ~
1820
21+ # TODO automation trigger
1922 # repository_dispatch:
2023 # types: [eccodes-updated]
2124
22- push :
23- tags-ignore :
24- - ' **'
25- paths :
26- - ' scripts/common.sh'
27- - ' scripts/select-python-linux.sh'
28- - ' scripts/wheel-linux.sh'
29- - ' scripts/build-linux.sh'
30- - ' scripts/test-linux.sh'
31- - ' scripts/copy-licences.py'
32- - ' .github/workflows/build-wheel-linux.yml'
33-
34- # to allow the action to run on the manylinux docker image based on CentOS 7
35- env :
36- ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
37-
3825jobs :
39-
4026 build :
41-
42- # if: false # for temporarily disabling for debugging
43-
27+ name : Build manylinux_2_28
4428 runs-on : [self-hosted, Linux, platform-builder-Rocky-8.6]
45- container : dockcross/manylinux2014-x64:latest
46-
47- name : Build manylinux2014
48-
29+ # TODO which manylinux do we want to build for? 2014? 2_28? 2_34? Matrix?
30+ container :
31+ image : eccr.ecmwf.int/wheelmaker/2_28:latest
32+ credentials :
33+ username : ${{ secrets.ECMWF_DOCKER_REGISTRY_USERNAME }}
34+ password : ${{ secrets.ECMWF_DOCKER_REGISTRY_ACCESS_TOKEN }}
4935 steps :
50- - uses : actions/checkout@v2
51-
52- - run : ./scripts/build-linux.sh
53-
54- # ###############################################################
55- - run : ./scripts/wheel-linux.sh 3.8
56- - uses : actions/upload-artifact@v4
57- name : Upload wheel 3.8
58- with :
59- name : wheel-manylinux2014-3.8
60- path : wheelhouse/*.whl
61-
62- # ################################################################
63- - run : ./scripts/wheel-linux.sh 3.9
64- - uses : actions/upload-artifact@v4
65- name : Upload wheel 3.9
66- with :
67- name : wheel-manylinux2014-3.9
68- path : wheelhouse/*.whl
69-
70- # ################################################################
71- - run : ./scripts/wheel-linux.sh 3.10
72- - uses : actions/upload-artifact@v4
73- name : Upload wheel 3.10
74- with :
75- name : wheel-manylinux2014-3.10
76- path : wheelhouse/*.whl
77-
78- # ################################################################
79- - run : ./scripts/wheel-linux.sh 3.11
80- - uses : actions/upload-artifact@v4
81- name : Upload wheel 3.11
82- with :
83- name : wheel-manylinux2014-3.11
84- path : wheelhouse/*.whl
85-
86- # ################################################################
87- - run : ./scripts/wheel-linux.sh 3.12
88- - uses : actions/upload-artifact@v4
89- name : Upload wheel 3.12
90- with :
91- name : wheel-manylinux2014-3.12
92- path : wheelhouse/*.whl
93-
94- test :
95-
96- needs : build
97-
98- strategy :
99- fail-fast : false
100- matrix : # We don't test 3.6, as it is not supported anymore by github actions
101- python-version : ["3.8", "3.9", "3.10", "3.11", "3.12"]
102-
103- runs-on : [self-hosted, Linux, platform-builder-Rocky-8.6]
104-
105- name : Test with ${{ matrix.python-version }}
106-
107- steps :
108-
109- - uses : actions/checkout@v2
110-
111- - uses : actions/download-artifact@v4
112- with :
113- name : wheel-manylinux2014-${{ matrix.python-version }}
114-
115- - run : ./scripts/test-linux.sh ${{ matrix.python-version }}
116-
117-
118- deploy :
119-
120- if : ${{ github.ref_type == 'tag' || github.event_name == 'release' }}
121-
122- strategy :
123- fail-fast : false
124- matrix :
125- python-version : ["3.8", "3.9", "3.10", "3.11", "3.12"]
126-
127- needs : [test, build]
128-
129- name : Deploy wheel ${{ matrix.python-version }}
130-
131- runs-on : [self-hosted, Linux, platform-builder-Rocky-8.6]
132-
133-
134- steps :
135-
136- - run : mkdir artifact-${{ matrix.python-version }}
137-
138- - uses : actions/checkout@v2
139-
140- - uses : actions/download-artifact@v4
141- with :
142- name : wheel-manylinux2014-${{ matrix.python-version }}
143- path : artifact-${{ matrix.python-version }}
144-
36+ # TODO convert this to be matrix-friendly. Note it's a bit tricky since
37+ # we'd ideally not reexecute the compile step multiple times, but it
38+ # (non-essentially) depends on a matrix-based step
39+ # NOTE we dont use action checkout because it doesnt cleanup after itself correctly
40+ - run : git clone --depth=1 --branch="${GITHUB_REF#refs/heads/}" https://github.com/$GITHUB_REPOSITORY /proj
41+ - run : cd /proj && /buildscripts/prepare_deps.sh ./buildconfig 3.11
14542 - run : |
146- source ./scripts/select-python-linux.sh 3.10
147- pip3 install twine
148- ls -l artifact-${{ matrix.python-version }}/*.whl
149- twine upload artifact-${{ matrix.python-version }}/*.whl
43+ cd /proj
44+ export PYTHONPATH=/buildscripts/; export LIBDIR=/tmp/prereqs/eccodeslib/lib64; export INCDIR=/tmp/prereqs/eccodeslib/include
45+ uv run --python python3.11 python -m build --installer uv --wheel .
46+ - run : mkdir -p /build/wheel && mv /proj/dist/*whl /build/wheel
47+ - run : cd /proj && /buildscripts/test-wheel.sh ./python_wrapper/buildconfig 3.11 /build/wheel/*whl
48+ - run : cd /proj && /buildscripts/upload-pypi.sh /build/wheel/*whl
15049 env :
15150 TWINE_USERNAME : __token__
152- TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
51+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
52+ # NOTE temporary thing until all the mess gets cleared
53+ - run : rm -rf ./* ./.git ./.github
0 commit comments