|
| 1 | +# (C) Copyright 2024- ECMWF. |
| 2 | +# |
| 3 | +# This software is licensed under the terms of the Apache Licence Version 2.0 |
| 4 | +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. |
| 5 | +# In applying this licence, ECMWF does not waive the privileges and immunities |
| 6 | +# granted to it by virtue of its status as an intergovernmental organisation |
| 7 | +# nor does it submit to any jurisdiction. |
| 8 | + |
| 9 | + |
| 10 | +name: Build Python Wheel for Linux |
| 11 | + |
| 12 | +on: |
| 13 | + # Trigger the workflow manually |
| 14 | + workflow_dispatch: ~ |
| 15 | + |
| 16 | + # Allow to be called from another workflow |
| 17 | + workflow_call: ~ |
| 18 | + |
| 19 | + # TODO automation trigger |
| 20 | + |
| 21 | +jobs: |
| 22 | + build: |
| 23 | + name: Build manylinux_2_28 |
| 24 | + runs-on: [self-hosted, Linux, platform-builder-Rocky-8.6] |
| 25 | + # TODO which manylinux do we want to build for? 2014? 2_28? 2_34? Matrix? |
| 26 | + container: |
| 27 | + image: eccr.ecmwf.int/wheelmaker/2_28:latest |
| 28 | + credentials: |
| 29 | + username: ${{ secrets.ECMWF_DOCKER_REGISTRY_USERNAME }} |
| 30 | + password: ${{ secrets.ECMWF_DOCKER_REGISTRY_ACCESS_TOKEN }} |
| 31 | + steps: |
| 32 | + # TODO convert this to be matrix-friendly. Note it's a bit tricky since |
| 33 | + # we'd ideally not reexecute the compile step multiple times, but it |
| 34 | + # (non-essentially) depends on a matrix-based step |
| 35 | + # NOTE we dont use action checkout because it doesnt cleanup after itself correctly |
| 36 | + - run: git clone --depth=1 --branch="${GITHUB_REF#refs/heads/}" https://github.com/$GITHUB_REPOSITORY /proj |
| 37 | + - run: cd /proj && /buildscripts/prepare_deps.sh ./python_wrapper/buildconfig 3.11 |
| 38 | + - run: cd /proj && /buildscripts/compile.sh ./python_wrapper/buildconfig |
| 39 | + - run: cd /proj && PYTHONPATH=/buildscripts /buildscripts/wheel-linux.sh ./python_wrapper/buildconfig 3.11 |
| 40 | + - run: cd /proj && /buildscripts/test-wheel.sh ./python_wrapper/buildconfig 3.11 /tmp/build/wheel/*whl |
| 41 | + - run: cd /proj && /buildscripts/upload-pypi.sh /tmp/build/wheel/*whl |
| 42 | + env: |
| 43 | + TWINE_USERNAME: __token__ |
| 44 | + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |
| 45 | + # NOTE temporary thing until all the mess gets cleared |
| 46 | + - run: rm -rf ./* ./.git ./.github |
0 commit comments