pixel-perfect #68
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: pixel-perfect | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "5 14 * * FRI" | |
jobs: | |
a: | |
strategy: | |
matrix: | |
os: | |
- windows-latest | |
- macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
set -x | |
SKIAVERSION="$(gh api repos/aseprite/skia/releases/latest | jq -r .tag_name)" | |
VERSION="$(gh api repos/aseprite/aseprite/releases/latest | jq -r .tag_name)" | |
# VERSION=v1.2.39 | |
mkdir -p a b c | |
curl -LO "https://github.com/aseprite/aseprite/releases/download/$VERSION/Aseprite-$VERSION-Source.zip" | |
unzip -qo Aseprite-$VERSION-Source.zip -d a | |
curl -LO "https://github.com/aseprite/skia/releases/download/$SKIAVERSION/Skia-${{ runner.os }}-Release-x64.zip" | |
unzip -qo Skia-${{ runner.os }}-Release-x64.zip -d c | |
- if: runner.os == 'Windows' | |
shell: bash | |
run: | | |
cd b | |
# Aseprite不支持在Windows上用g++编译,PATH中的MinGW会干扰CMake判断。因为找不到对应的Chocolatey包来卸,故以暴力手段处理,反正主机是一次性的。 | |
for i in c++ cpp gcc g++ cc ar as ld nm ranlib windres gfortran make mingw32-make ccache | |
do | |
while rm -v $(which $i 2>/dev/null) 2>/dev/null | |
do | |
: | |
done | |
done | |
- if: runner.os == 'Windows' | |
shell: cmd | |
run: | | |
cd b | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
cmake -DSKIA_DIR=..\c -DSKIA_LIBRARY_DIR=..\c\out\Release-x64 -DSKIA_LIBRARY=..\c\out\Release-x64\skia.lib ^ | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DLAF_BACKEND=skia -G Ninja ..\a | |
ninja aseprite | |
7z a b.7z bin | |
- if: runner.os == 'macOS' | |
shell: bash | |
run: | | |
brew install ninja | |
cd b | |
cmake \ | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DCMAKE_OSX_ARCHITECTURES=x86_64 \ | |
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \ | |
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \ | |
-DLAF_BACKEND=skia \ | |
-DSKIA_DIR=../c \ | |
-DSKIA_LIBRARY_DIR=../c/out/Release-x64 \ | |
-DSKIA_LIBRARY=../c/out/Release-x64/libskia.a \ | |
-G Ninja ../a | |
ninja aseprite | |
7z a b.7z bin | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }} | |
path: b/b.7z |