Build afs.cmd #50
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
name: Build afs.cmd | |
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, linux-musl, osx] | |
arch: [x64, arm64] | |
include: | |
- os: windows-latest | |
target: win | |
- os: windows-latest | |
target: linux-musl | |
- os: macos-latest | |
target: osx | |
dotnet_version: ['8.0.403'] | |
steps: | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet_version }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# - name: Update submodule | |
# run: git submodule update --init --recursive | |
- name: Test | |
run: | | |
dotnet --version | |
cd ./AssFontSubset.CoreTests | |
dotnet restore | |
dotnet test | |
cd .. | |
- name: Setup Zig Compiler (target linux) | |
if: matrix.target == 'linux-musl' | |
uses: mlugg/setup-zig@v1 | |
with: | |
version: "master" | |
- name: Add llvm-objcopy | |
if: matrix.target == 'linux-musl' | |
run: | | |
Invoke-WebRequest -Uri https://github.com/MIRIMIRIM/FontFlat/releases/download/harfbuzz-libs/llvm-objcopy.exe -OutFile ./AssFontSubset.Console/llvm-objcopy.exe | |
- name: Use prebuilt harfbuzz subset | |
uses: actions/cache/restore@v4 | |
with: | |
path: ./HarfBuzzBinding/target | |
key: hb-subset-${{ matrix.harfbuzz_ver }}-${{ env.identifier }}-static | |
fail-on-cache-miss: true | |
- name: Change to afs.cmd and Publish | |
run: | | |
mkdir native | |
mv ./HarfBuzzBinding/target/* ./native/ | |
cd ./AssFontSubset.Console | |
dotnet restore | |
dotnet publish -c Release -r ${{ env.identifier }} -f net8.0 | |
cd .. | |
- name: Set short version | |
shell: bash | |
run: | | |
ver_short=`git rev-parse --short HEAD` | |
echo "VERSION=$ver_short" >> $GITHUB_ENV | |
- name: Upload exe files | |
uses: actions/upload-artifact@v4 | |
with: | |
name: AssFontSubset.Console_g${{ env.VERSION }}_${{ env.identifier }} | |
path: | | |
AssFontSubset.Console/bin/Release/net8.0/${{ env.identifier }}/publish/ | |
!AssFontSubset.Console/bin/Release/net8.0/${{ env.identifier }}/publish/*.pdb | |
!AssFontSubset.Console/bin/Release/net8.0/${{ env.identifier }}/publish/*.dbg | |
!AssFontSubset.Console/bin/Release/net8.0/${{ env.identifier }}/publish/*.dwarf | |
!AssFontSubset.Console/bin/Release/net8.0/${{ env.identifier }}/publish/*.dsym |