-
Notifications
You must be signed in to change notification settings - Fork 7
117 lines (100 loc) · 4.83 KB
/
CI-MacOS-Universal-Clang.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
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
name: CI-MacOS-Universal-Clang
on:
push:
branches:
- main
paths-ignore:
- README.md
- LICENSE
pull_request:
paths-ignore:
- README.md
- LICENSE
workflow_dispatch:
env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
jobs:
macos:
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.2.0'
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Check Python version
run: |
python --version
- name: cache-vulkansdk
id: cache-vulkansdk
uses: actions/[email protected]
with:
path: "src/vulkansdk-macos-1.2.162.1"
key: vulkansdk-macos-1.2.162.1
- name: vulkansdk
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: |
cd src
wget https://github.com/Tohrusky/realcugan-ncnn-vulkan-build-macOS/releases/download/v0.0.1/vulkansdk-macos-1.2.162.1.dmg -O vulkansdk-macos-1.2.162.1.dmg
hdiutil attach vulkansdk-macos-1.2.162.1.dmg
cp -r /Volumes/vulkansdk-macos-1.2.162.1 .
rm -rf vulkansdk-macos-1.2.162.1/Applications
find vulkansdk-macos-1.2.162.1 -type f | grep -v -E 'vulkan|glslang|MoltenVK' | xargs rm
hdiutil detach /Volumes/vulkansdk-macos-1.2.162.1
- name: build-arm64
run: |
cd src
export VULKAN_SDK=`pwd`/vulkansdk-macos-1.2.162.1/macOS
mkdir build-arm64 && cd build-arm64
cmake -DUSE_STATIC_MOLTENVK=ON -DCMAKE_OSX_ARCHITECTURES="arm64" \
-DCMAKE_CROSSCOMPILING=ON -DCMAKE_SYSTEM_PROCESSOR=arm64 \
-DVulkan_INCLUDE_DIR=`pwd`/../vulkansdk-macos-1.2.162.1/MoltenVK/include \
-DVulkan_LIBRARY=`pwd`/../vulkansdk-macos-1.2.162.1/MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/libMoltenVK.a \
..
cmake --build . -j 4
- name: build-x86_64
run: |
cd src
export VULKAN_SDK=`pwd`/vulkansdk-macos-1.2.162.1/macOS
mkdir build-x86_64 && cd build-x86_64
cmake -DUSE_STATIC_MOLTENVK=ON -DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DCMAKE_CROSSCOMPILING=ON -DCMAKE_SYSTEM_PROCESSOR=x86_64 \
-DVulkan_INCLUDE_DIR=`pwd`/../vulkansdk-macos-1.2.162.1/MoltenVK/include \
-DVulkan_LIBRARY=`pwd`/../vulkansdk-macos-1.2.162.1/MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/libMoltenVK.a \
..
cmake --build . -j 4
- name: merge-fat-library-py36m
if: matrix.python-version == '3.6'
run: mkdir -p dist && lipo -create src/build-arm64/realesrgan_ncnn_vulkan_wrapper.cpython-36m-darwin.so src/build-x86_64/realesrgan_ncnn_vulkan_wrapper.cpython-36m-darwin.so -o dist/realesrgan_ncnn_vulkan_wrapper.cpython-36m-darwin.so
- name: merge-fat-library-py37m
if: matrix.python-version == '3.7'
run: mkdir -p dist && lipo -create src/build-arm64/realesrgan_ncnn_vulkan_wrapper.cpython-37m-darwin.so src/build-x86_64/realesrgan_ncnn_vulkan_wrapper.cpython-37m-darwin.so -o dist/realesrgan_ncnn_vulkan_wrapper.cpython-37m-darwin.so
- name: merge-fat-library-py38
if: matrix.python-version == '3.8'
run: mkdir -p dist && lipo -create src/build-arm64/realesrgan_ncnn_vulkan_wrapper.cpython-38-darwin.so src/build-x86_64/realesrgan_ncnn_vulkan_wrapper.cpython-38-darwin.so -o dist/realesrgan_ncnn_vulkan_wrapper.cpython-38-darwin.so
- name: merge-fat-library-py39
if: matrix.python-version == '3.9'
run: mkdir -p dist && lipo -create src/build-arm64/realesrgan_ncnn_vulkan_wrapper.cpython-39-darwin.so src/build-x86_64/realesrgan_ncnn_vulkan_wrapper.cpython-39-darwin.so -o dist/realesrgan_ncnn_vulkan_wrapper.cpython-39-darwin.so
- name: merge-fat-library-py310
if: matrix.python-version == '3.10'
run: mkdir -p dist && lipo -create src/build-arm64/realesrgan_ncnn_vulkan_wrapper.cpython-310-darwin.so src/build-x86_64/realesrgan_ncnn_vulkan_wrapper.cpython-310-darwin.so -o dist/realesrgan_ncnn_vulkan_wrapper.cpython-310-darwin.so
- name: merge-fat-library-py311
if: matrix.python-version == '3.11'
run: mkdir -p dist && lipo -create src/build-arm64/realesrgan_ncnn_vulkan_wrapper.cpython-311-darwin.so src/build-x86_64/realesrgan_ncnn_vulkan_wrapper.cpython-311-darwin.so -o dist/realesrgan_ncnn_vulkan_wrapper.cpython-311-darwin.so
- name: dist
run: |
cp src/realesrgan_ncnn_vulkan.py dist
cp -r models dist
- name: upload
uses: actions/upload-artifact@v3
with:
name: realesrgan-ncnn-macos-python${{ matrix.python-version }}
path: dist