-
Notifications
You must be signed in to change notification settings - Fork 12
91 lines (86 loc) · 2.82 KB
/
packaging.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
87
88
89
90
91
name: Packaging
on:
release:
types: [published]
workflow_dispatch:
jobs:
wheels:
name: Build ${{ matrix.os }} wheels
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
env:
CIBW_SKIP: cp27-* pp*
CIBW_BEFORE_ALL: >
pip install cmake>=3.5 &&
git clone https://github.com/libjxl/libjxl.git --recursive --shallow-submodules &&
cd libjxl* &&
git checkout v0.9.1 &&
mkdir build && cd build &&
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DJPEGXL_ENABLE_BENCHMARK=OFF -DJPEGXL_ENABLE_TOOLS=OFF -DJPEGXL_ENABLE_DEVTOOLS=OFF .. &&
cmake --build . -- -j$(nproc) &&
cmake --install . &&
cp ./third_party/brotli/*.so* /usr/local/lib
steps:
- name: Add /usr/local/lib to LD_LIBRARY_PATH
run: echo 'LD_LIBRARY_PATH=/usr/local/lib' >> $GITHUB_ENV
if: runner.os == 'Linux'
- name: Print info
run: ldd --version && uname -a
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@master
with:
name: wheelhouse-${{ matrix.os }}
path: wheelhouse
- name: Publish package
run: python -m pip install twine && python -m twine upload wheelhouse/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_password }}
sdist:
name: Build source distribution
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Install dependencies
run: >
pip install cmake>=3.5 &&
git clone https://github.com/libjxl/libjxl.git --recursive --shallow-submodules &&
cd libjxl* &&
git checkout v0.9.1 &&
mkdir build && cd build &&
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DJPEGXL_ENABLE_BENCHMARK=OFF -DJPEGXL_ENABLE_TOOLS=OFF -DJPEGXL_ENABLE_DEVTOOLS=OFF .. &&
cmake --build . -- -j$(nproc) &&
cmake --install . &&
cp ./third_party/brotli/*.so* /usr/local/lib
- name: Install python-build
run: python -m pip install build
- name: Create packages
run: python -m build --sdist .
- uses: actions/upload-artifact@master
with:
name: dist
path: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}