-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gha: build harfbuzz and nativeaot afs.cmd (#23)
- Loading branch information
Showing
9 changed files
with
241 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[built-in options] | ||
c_args = ['-target', 'aarch64-linux-musl'] | ||
cpp_args = ['-target', 'aarch64-linux-musl'] | ||
c_link_args = ['-target', 'aarch64-linux-musl'] | ||
cpp_link_args = ['-target', 'aarch64-linux-musl'] | ||
|
||
[host_machine] | ||
system = 'linux' | ||
cpu_family = 'aarch64' | ||
cpu = 'aarch64' | ||
endian = 'little' | ||
|
||
; meson --native-file .\build_scripts\zig.ini --cross-file .\build_scripts\zig.ini --cross-file .\build_scripts\linux-musl-arm64.ini -Ddefault_library=static ./build/linux-arm64-static-musl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[built-in options] | ||
c_args = ['-target', 'x86_64-linux-musl'] | ||
cpp_args = ['-target', 'x86_64-linux-musl'] | ||
c_link_args = ['-target', 'x86_64-linux-musl'] | ||
cpp_link_args = ['-target', 'x86_64-linux-musl'] | ||
|
||
[host_machine] | ||
system = 'linux' | ||
cpu_family = 'x86_64' | ||
cpu = 'x86_64' | ||
endian = 'little' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[binaries] | ||
c = ['clang'] | ||
cpp = ['clang'] | ||
|
||
[built-in options] | ||
c_args = ['-target', 'x86_64-apple-darwin'] | ||
cpp_args = ['-target', 'x86_64-apple-darwin'] | ||
|
||
[host_machine] | ||
system = 'darwin' | ||
cpu_family = 'x86_64' | ||
cpu = 'x86_64' | ||
endian = 'little' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[project options] | ||
glib='disabled' | ||
gobject='disabled' | ||
cairo='disabled' | ||
chafa='disabled' | ||
icu='disabled' | ||
freetype='disabled' | ||
tests='disabled' | ||
introspection='disabled' | ||
docs='disabled' | ||
doc_tests=false | ||
utilities='disabled' | ||
experimental_api=true | ||
|
||
[built-in options] | ||
buildtype='release' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[binaries] | ||
c = ['cl'] | ||
cpp = ['cl'] | ||
|
||
[host_machine] | ||
system = 'windows' | ||
cpu_family = 'aarch64' | ||
cpu = 'aarch64' | ||
endian = 'little' | ||
|
||
; vcvarsall.bat x64_arm64 | ||
; meson --cross-file .\build_scripts\project.ini --cross-file .\build_scripts\win-arm64.ini -Ddefault_library=static -Db_vscrt=static_from_buildtype ./build/win-arm64-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[binaries] | ||
c = ['zig', 'cc'] | ||
cpp = ['zig', 'c++'] | ||
ar = ['zig', 'ar'] | ||
ranlib = ['zig', 'ranlib'] | ||
lib = ['zig', 'lib'] | ||
dlltool = ['zig', 'dlltool'] | ||
|
||
[built-in options] | ||
cpp_std = ['c++14'] |