-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (73 loc) · 2.88 KB
/
build.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
name: build wheels
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
- name: Install dependencies
run: |
python -m pip install build pytest
- run: mkdir -p build
- name: Parse icu-versions.json
id: icu
shell: bash
run: |
latest=`cat ./icu-versions.json | jq -r .latest`
echo "latest=$latest"
content=`cat ./icu-versions.json | jq -c ".versions[] | select(.version == \"$latest\")"`
echo "icu4c=$content"
echo "icu4c_latest_version=$latest" >> $GITHUB_ENV
echo "icu4c_target_json=$content" >> $GITHUB_ENV
- name: Set up requirements (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
working-directory: build
run: |
curl -LO ${{fromJson(env.icu4c_target_json).url}}/${{fromJson(env.icu4c_target_json).icu4c_ubuntu_x64_tgz}}
sudo tar zxf ${{fromJson(env.icu4c_target_json).icu4c_ubuntu_x64_tgz}} -C / --strip-components=2
echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Set up requirements (Windows)
if: startsWith(matrix.os, 'windows')
working-directory: build
env:
INSTALL_PREFIX: "${{github.workspace}}/build"
ICU4C_DIR: "icu4c"
run: |
curl -LO ${{fromJson(env.icu4c_target_json).url}}/${{fromJson(env.icu4c_target_json).icu4c_win64_zip}}
7z x ${{fromJson(env.icu4c_target_json).icu4c_win64_zip}} -o${{env.ICU4C_DIR}}
if ("x${{fromJson(env.icu4c_target_json).double_zipped_filename}}" -ne "x") {
7z x ${{env.ICU4C_DIR}}/${{fromJson(env.icu4c_target_json).double_zipped_filename}} -o${{env.ICU4C_DIR}}
}
echo "ICU_ROOT=${{env.INSTALL_PREFIX}}/${{env.ICU4C_DIR}}" >> $env:GITHUB_ENV
- name: Build wheel
run: |
pyproject-build --wheel
- name: Store wheel
uses: actions/upload-artifact@v4
with:
name: dist-icupy-icu${{env.icu4c_latest_version}}-${{matrix.os}}-${{matrix.python-version}}
path: dist/*.whl
- name: Run tests
run: |
python -m pip install --no-deps --no-index --find-links=./dist/ --force-reinstall icupy
pytest