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 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
|
# (C) Copyright 2024- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.
name: Build Windows
on:
# Trigger the workflow manually
workflow_dispatch: ~
# Allow to be called from another workflow
workflow_call: ~
push:
tags-ignore:
- '**'
paths:
- 'scripts/common.sh'
- 'scripts/wheel-windows.sh'
- 'scripts/build-windows.sh'
- 'scripts/copy-dlls.py'
- 'scripts/copy-licences.py'
- '.github/workflows/build-wheel-windows.yml'
jobs:
build:
# if: false # for temporarily disabling for debugging
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
architecture: ["x64"]
defaults:
run:
shell: bash
name: Build on ${{ matrix.architecture }}
env:
WINARCH: ${{ matrix.architecture }}
steps:
- uses: actions/checkout@v2
- uses: seanmiddleditch/gha-setup-vsdevenv@master
with:
arch: ${{ matrix.architecture }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: ${{ matrix.architecture }}
- run: ./scripts/build-windows.sh
env:
WINARCH: ${{ matrix.architecture }}
################################################################
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: ${{ matrix.architecture }}
- run: ./scripts/wheel-windows.sh 3.9
- uses: actions/upload-artifact@v4
name: Upload wheel 3.9
with:
name: wheel-windows-3.9-${{ matrix.architecture }}
path: wheelhouse/*.whl
################################################################
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: ${{ matrix.architecture }}
- run: ./scripts/wheel-windows.sh "3.10"
- uses: actions/upload-artifact@v4
name: Upload wheel 3.10
with:
name: wheel-windows-3.10-${{ matrix.architecture }}
path: wheelhouse/*.whl
################################################################
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
architecture: ${{ matrix.architecture }}
- run: ./scripts/wheel-windows.sh "3.11"
- uses: actions/upload-artifact@v4
name: Upload wheel 3.11
with:
name: wheel-windows-3.11-${{ matrix.architecture }}
path: wheelhouse/*.whl
################################################################
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
architecture: ${{ matrix.architecture }}
- run: ./scripts/wheel-windows.sh "3.12"
- uses: actions/upload-artifact@v4
name: Upload wheel 3.12
with:
name: wheel-windows-3.12-${{ matrix.architecture }}
path: wheelhouse/*.whl
################################################################
- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: "3.13"
architecture: ${{ matrix.architecture }}
- run: ./scripts/wheel-windows.sh "3.13"
- uses: actions/upload-artifact@v4
name: Upload wheel 3.13
with:
name: wheel-windows-3.13-${{ matrix.architecture }}
path: wheelhouse/*.whl
################################################################
test:
needs: build
runs-on: windows-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
architecture: ["x64"]
defaults:
run:
shell: bash
name: Test with Python ${{ matrix.python-version }} ${{ matrix.architecture }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- uses: actions/download-artifact@v4
with:
name: wheel-windows-${{ matrix.python-version }}-${{ matrix.architecture }}
- run: pip install *.whl
- run: pip install -r tests/requirements.txt
- run: pip freeze
- run: ECCODES_PYTHON_TRACE_LIB_SEARCH=1 pytest --verbose -s
working-directory: tests
timeout-minutes: 2
deploy:
if: ${{ github.ref_type == 'tag' || github.event_name == 'release' }}
needs: [test, build]
name: Deploy wheel ${{ matrix.python-version }} ${{ matrix.architecture }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
architecture: ["x64"]
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip install twine
- uses: actions/download-artifact@v4
with:
name: wheel-windows-${{ matrix.python-version }}-${{ matrix.architecture }}
- run: twine upload *.whl
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|