2
2
# runs the compilation and bundles all artifacts (libs, includes, ...) into
3
3
# a binary wheel (manylinux/macos) along with findlibs-compatible instructions
4
4
# about dependencies
5
- # Assumes that the project has the `python_wrapper` directory which configures
6
- # this action
5
+ # Accepts `wheel_directory` parameter, by default `python_wrapper`, with files
6
+ # that configure this action -- `buildconfig`, `pyproject.toml`, `setup.py`, and
7
+ # a few optional bash scripts such as `pre-compile.sh`
7
8
8
9
on :
9
10
workflow_call :
13
14
required : false
14
15
type : boolean
15
16
default : false # TODO actually use this
16
-
17
+ wheel_directory :
18
+ description : Path to the directory with buildconfig and pyproject
19
+ required : false
20
+ type : string
21
+ default : python_wrapper
17
22
jobs :
18
23
linux-wheel :
19
24
name : Build manylinux_2_28
@@ -28,25 +33,24 @@ jobs:
28
33
runs-on : [self-hosted, Linux, platform-builder-Rocky-8.6]
29
34
container :
30
35
image : eccr.ecmwf.int/wheelmaker/2_28:latest
36
+ options : --user github-actions
31
37
credentials :
32
38
username : ${{ secrets.ECMWF_DOCKER_REGISTRY_USERNAME }}
33
39
password : ${{ secrets.ECMWF_DOCKER_REGISTRY_ACCESS_TOKEN }}
34
40
steps :
35
41
# 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 "${{ matrix.python_version }}"
38
- - run : cd /proj && if [[ -f ./python_wrapper /pre-compile.sh ]] ; then ./python_wrapper /pre-compile.sh ; fi
39
- - run : cd /proj && /buildscripts/compile.sh ./python_wrapper /buildconfig
40
- - run : cd /proj && if [[ -f ./python_wrapper /post-compile.sh ]] ; then ./python_wrapper /post-compile.sh ; fi
41
- - run : cd /proj && GITHUB_BRANCH="${GITHUB_REF}" PYTHONPATH=/buildscripts /buildscripts/wheel-linux.sh ./python_wrapper /buildconfig "${{ matrix.python_version }}"
42
- - run : cd /proj && if [[ -f ./python_wrapper /post-build.sh ]] ; then ./python_wrapper /post-build.sh ; fi
43
- - run : cd /proj && /buildscripts/test-wheel.sh ./python_wrapper /buildconfig "${{ matrix.python_version }}"
44
- - run : cd /proj && PYTHONPATH=/buildscripts /buildscripts/upload-pypi.sh ./python_wrapper /buildconfig
42
+ - run : git clone --depth=1 --branch="${GITHUB_REF#refs/heads/}" https://github.com/$GITHUB_REPOSITORY /src/ proj
43
+ - run : cd /src/ proj && /buildscripts/prepare_deps.sh ./${{ inputs.wheel_directory }} /buildconfig "${{ matrix.python_version }}"
44
+ - run : cd /src/ proj && if [[ -f ./${{ inputs.wheel_directory }} /pre-compile.sh ]] ; then ./${{ inputs.wheel_directory }} /pre-compile.sh ; fi
45
+ - run : cd /src/ proj && /buildscripts/compile.sh ./${{ inputs.wheel_directory }} /buildconfig
46
+ - run : cd /src/ proj && if [[ -f ./${{ inputs.wheel_directory }} /post-compile.sh ]] ; then ./${{ inputs.wheel_directory }} /post-compile.sh ; fi
47
+ - run : cd /src/ proj && GITHUB_BRANCH="${GITHUB_REF}" PYTHONPATH=/buildscripts /buildscripts/wheel-linux.sh ./${{ inputs.wheel_directory }} /buildconfig "${{ matrix.python_version }}"
48
+ - run : cd /src/ proj && if [[ -f ./${{ inputs.wheel_directory }} /post-build.sh ]] ; then ./${{ inputs.wheel_directory }} /post-build.sh ; fi
49
+ - run : cd /src/ proj && GITHUB_BRANCH="${GITHUB_REF}" /buildscripts/test-wheel.sh ./${{ inputs.wheel_directory }} /buildconfig "${{ matrix.python_version }}"
50
+ - run : cd /src/ proj && PYTHONPATH=/buildscripts /buildscripts/upload-pypi.sh ./${{ inputs.wheel_directory }} /buildconfig
45
51
env :
46
52
TWINE_USERNAME : __token__
47
53
TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
48
- # NOTE temporary thing until all the mess gets cleared
49
- - run : rm -rf ./* ./.git ./.github
50
54
macos-wheel :
51
55
name : Build macos wheel
52
56
strategy :
@@ -74,21 +78,19 @@ jobs:
74
78
- run : rm -rf proj && git clone --depth=1 --branch="${GITHUB_REF#refs/heads/}" https://github.com/$GITHUB_REPOSITORY proj
75
79
- run : |
76
80
uv python install python"${{ matrix.python_version }}"
77
- cd proj && $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/prepare_deps.sh ./python_wrapper /buildconfig "${{ matrix.python_version }}"
81
+ cd proj && $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/prepare_deps.sh ./${{ inputs.wheel_directory }} /buildconfig "${{ matrix.python_version }}"
78
82
- run : |
79
83
cd proj
80
- if [[ -f ./python_wrapper /pre-compile.sh ]] ; then ./python_wrapper /pre-compile.sh ; fi
81
- PATH="$PATH:$ GITHUB_WORKSPACE/ecbuild/bin/" $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/compile.sh ./python_wrapper /buildconfig
82
- if [[ -f ./python_wrapper /post-compile.sh ]] ; then ./python_wrapper /post-compile.sh ; fi
84
+ if [[ -f ./${{ inputs.wheel_directory }} /pre-compile.sh ]] ; then ./${{ inputs.wheel_directory }} /pre-compile.sh ; fi
85
+ PATH="$GITHUB_WORKSPACE/ecbuild/bin/:$PATH " $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/compile.sh ./${{ inputs.wheel_directory }} /buildconfig
86
+ if [[ -f ./${{ inputs.wheel_directory }} /post-compile.sh ]] ; then ./${{ inputs.wheel_directory }} /post-compile.sh ; fi
83
87
- run : |
84
88
cd proj
85
- rm -rf /tmp/buildvenv && uv venv --python python"${{ matrix.python_version }}" /tmp/buildvenv && source /tmp/buildvenv/bin/activate && uv pip install build twine delocate setuptools requests
86
- GITHUB_BRANCH="${GITHUB_REF}" PYTHONPATH=$GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/wheel-linux.sh ./python_wrapper /buildconfig "${{ matrix.python_version }}"
87
- if [[ -f ./python_wrapper /post-build.sh ]] ; then ./python_wrapper /post-build.sh ; fi
88
- $ GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/test-wheel.sh ./python_wrapper /buildconfig "${{ matrix.python_version }}"
89
- PYTHONPATH=$GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/upload-pypi.sh ./python_wrapper /buildconfig
89
+ rm -rf /tmp/buildvenv && uv venv --python python"${{ matrix.python_version }}" /tmp/buildvenv && source /tmp/buildvenv/bin/activate && uv pip install build twine==6.0.1 delocate setuptools requests # NOTE twine version forced due to metadata issue, cf wheelmaker Dockerfile
90
+ GITHUB_BRANCH="${GITHUB_REF}" PYTHONPATH=$GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/wheel-linux.sh ./${{ inputs.wheel_directory }} /buildconfig "${{ matrix.python_version }}"
91
+ if [[ -f ./${{ inputs.wheel_directory }} /post-build.sh ]] ; then ./${{ inputs.wheel_directory }} /post-build.sh ; fi
92
+ GITHUB_BRANCH="${GITHUB_REF}" $ GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/test-wheel.sh ./${{ inputs.wheel_directory }} /buildconfig "${{ matrix.python_version }}"
93
+ PYTHONPATH=$GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts $GITHUB_WORKSPACE/ci-utils/wheelmaker/buildscripts/upload-pypi.sh ./${{ inputs.wheel_directory }} /buildconfig
90
94
env:
91
95
TWINE_USERNAME: __token__
92
96
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
93
- # NOTE temporary thing until all the mess gets cleared
94
- - run : rm -rf ./* ./.git ./.github
0 commit comments