-
Notifications
You must be signed in to change notification settings - Fork 4
118 lines (103 loc) · 4.55 KB
/
build-harfbuzz-subset.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
117
118
name: Build hb-subset
on:
push:
branches: [ "master" ]
paths:
- 'AssFontSubset.Core/**.cs'
- 'AssFontSubset.Core/**.csproj'
- 'AssFontSubset.Console/**.cs'
- 'AssFontSubset.Console/**.csproj'
pull_request:
branches: [ "master" ]
paths:
- 'AssFontSubset.Core/**.cs'
- 'AssFontSubset.Core/**.csproj'
- 'AssFontSubset.Console/**.cs'
- 'AssFontSubset.Console/**.csproj'
workflow_dispatch:
jobs:
build:
name: build-${{ matrix.target }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
env:
identifier: ${{ matrix.target }}-${{ matrix.arch }}
strategy:
matrix:
harfbuzz_ver: ['10.1.0']
target: [win, osx, linux-musl]
arch: [x64, arm64]
include:
- os: windows-latest
target: win
- os: windows-latest
target: linux-musl
- os: macos-latest
target: osx
steps:
- name: Set up cache
id: cache
uses: actions/cache@v4
with:
path: ./HarfBuzzBinding/target
key: hb-subset-${{ matrix.harfbuzz_ver }}-${{ env.identifier }}-static
restore-keys: |
hb-subset-${{ matrix.harfbuzz_ver }}-${{ env.identifier }}-static
- name: Check out code
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- name: Prepare
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install meson ninja
cd ./HarfBuzzBinding
git clone --recurse-submodules https://github.com/harfbuzz/harfbuzz.git -b ${{ matrix.harfbuzz_ver }} --depth=1 harfbuzz-${{ matrix.harfbuzz_ver }}
- name: Setup msbuild (target windows x64)
if: matrix.target == 'win' && matrix.arch == 'x64' && steps.cache.outputs.cache-hit != 'true'
uses: ilammy/msvc-dev-cmd@v1
- name: Setup msbuild (target windows arm64)
if: matrix.target == 'win' && matrix.arch == 'arm64' && steps.cache.outputs.cache-hit != 'true'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_arm64
- name: Setup Zig Compiler (target linux)
if: matrix.target == 'linux-musl' && steps.cache.outputs.cache-hit != 'true'
uses: mlugg/setup-zig@v1
with:
version: "master"
- name: Configure (windows-x64)
if: matrix.target == 'win' && matrix.arch == 'x64' && steps.cache.outputs.cache-hit != 'true'
run: |
cd ./HarfBuzzBinding/harfbuzz-${{ matrix.harfbuzz_ver }}
meson --native-file ../scripts/project.ini -Ddefault_library=static -Db_vscrt=static_from_buildtype build/${{ env.identifier }}-static
- name: Configure (windows-arm64)
if: matrix.target == 'win' && matrix.arch == 'arm64' && steps.cache.outputs.cache-hit != 'true'
run: |
cd ./HarfBuzzBinding/harfbuzz-${{ matrix.harfbuzz_ver }}
meson --cross-file ../scripts/project.ini --cross-file ../scripts/${{ env.identifier }}.ini -Ddefault_library=static -Db_vscrt=static_from_buildtype build/${{ env.identifier }}-static
- name: Configure (linux-musl)
if: matrix.target == 'linux-musl' && steps.cache.outputs.cache-hit != 'true'
run: |
cd ./HarfBuzzBinding/harfbuzz-${{ matrix.harfbuzz_ver }}
meson --native-file ../scripts/zig.ini --cross-file ../scripts/zig.ini --cross-file ../scripts/project.ini --cross-file ../scripts/${{ env.identifier }}.ini -Ddefault_library=static build/${{ env.identifier }}-static
- name: Configure (osx-arm64)
if: matrix.target == 'osx' && matrix.arch == 'arm64' && steps.cache.outputs.cache-hit != 'true'
run: |
cd ./HarfBuzzBinding/harfbuzz-${{ matrix.harfbuzz_ver }}
meson --native-file ../scripts/project.ini -Ddefault_library=static build/${{ env.identifier }}-static
- name: Configure (osx-x64)
if: matrix.target == 'osx' && matrix.arch == 'x64' && steps.cache.outputs.cache-hit != 'true'
run: |
cd ./HarfBuzzBinding/harfbuzz-${{ matrix.harfbuzz_ver }}
meson --cross-file ../scripts/project.ini --cross-file ../scripts/${{ env.identifier }}.ini -Ddefault_library=static build/${{ env.identifier }}-static
- name: Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd ./HarfBuzzBinding/harfbuzz-${{ matrix.harfbuzz_ver }}
meson compile -C build/${{ env.identifier }}-static
mkdir ../target
cp build/${{ env.identifier }}-static/src/*.a ../target/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: hb-subset-${{ matrix.harfbuzz_ver }}-${{ env.identifier }}-static
path: ./HarfBuzzBinding/target