From 011fd63c8b799fe0684682b20fc564d0a046ebef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=20=60=20=EF=BD=A5=20=CF=89=20=EF=BD=A5=20=C2=B4=20=29?= <104260515+MQ-H@users.noreply.github.com> Date: Sat, 14 Dec 2024 11:10:47 +0800 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 112 +++++++++++------------------------- 1 file changed, 32 insertions(+), 80 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b44061c9a..2841ea4467 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,52 +6,33 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest, macos-latest, ubuntu-latest] - build_type: [RelWithDebInfo, Debug] - ui: [gui, cli] - scripting: [lua, noscripts] - exclude: - - build_type: Debug - ui: gui - - build_type: RelWithDebInfo - ui: cli - - build_type: RelWithDebInfo - scripting: noscripts + os: [windows-latest] + build_type: [Release] + enable_ui: [on] + include: + - os: windows-latest + build_type: Release + enable_ui: on steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 with: submodules: 'recursive' - - name: Install Dependencies - if: runner.os == 'Linux' - shell: bash - run: | - sudo apt-get update -qq - sudo apt-get install -y \ - libpixman-1-dev libfreetype6-dev libharfbuzz-dev zlib1g-dev \ - libx11-dev libxcursor-dev libxi-dev libgl1-mesa-dev - - name: Install Skia - if: ${{ matrix.ui == 'gui' }} - shell: bash - run: | - if [[ "${{ runner.os }}" == "Windows" ]] ; then - choco install wget -y --no-progress - wget https://github.com/aseprite/skia/releases/download/m102-861e4743af/Skia-Windows-Release-x64.zip - unzip Skia-Windows-Release-x64.zip -d skia - elif [[ "${{ runner.os }}" == "macOS" ]] ; then - wget https://github.com/aseprite/skia/releases/download/m102-861e4743af/Skia-macOS-Release-arm64.zip - unzip Skia-macOS-Release-arm64.zip -d skia - else - wget https://github.com/aseprite/skia/releases/download/m102-861e4743af/Skia-Linux-Release-x64-libstdc++.zip - unzip Skia-Linux-Release-x64-libstdc++.zip -d skia - fi - name: ccache uses: hendrikmuhs/ccache-action@v1 - if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} + if: runner.os == 'Linux' with: - key: ${{ matrix.os }}-${{ matrix.ui }}-${{ matrix.scripting }}-${{ matrix.build_type }} - - uses: aseprite/get-ninja@main + key: ${{ matrix.os }}-${{ matrix.enable_ui }} + - uses: seanmiddleditch/gha-setup-ninja@master - uses: ilammy/msvc-dev-cmd@v1 if: runner.os == 'Windows' + - name: Install Dependencies + shell: bash + run: | + if [[ "${{ runner.os }}" == "Linux" ]] ; then + sudo apt-get update -qq + sudo apt-get install -y \ + libx11-dev libxcursor-dev libxi-dev + fi - name: Generating Makefiles shell: bash run: | @@ -60,52 +41,23 @@ jobs: else export enable_ccache=on fi - - if [[ "${{ matrix.ui }}" == "gui" ]] ; then - export laf_backend=skia - else - export laf_backend=none - fi - - if [[ "${{ matrix.scripting }}" == "lua" ]] ; then - export enable_scripting=on - else - export enable_scripting=off - fi - - if [[ "${{ runner.os }}" == "macOS" ]] ; then - export skia_arch=arm64 - else - export skia_arch=x64 - fi - + curl -L https://github.com/blueloveTH/aseprite/releases/download/v0.01/skia.zip --output skia.zip + 7z x skia.zip cmake -S . -B build -G Ninja \ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \ - -DENABLE_TESTS=ON \ - -DENABLE_SCRIPTING=$enable_scripting \ + -DENABLE_UI=${{ matrix.enable_ui }} \ -DENABLE_CCACHE=$enable_ccache \ - -DLAF_BACKEND=$laf_backend \ - -DSKIA_DIR=skia \ - -DSKIA_LIBRARY_DIR=skia/out/Release-$skia_arch + -DLAF_BACKEND=skia \ + -DSKIA_DIR=./skia \ + -DSKIA_LIBRARY_DIR=./skia/out/Release-x64 \ + -DSKIA_LIBRARY=./skia/out/Release-x64/skia.lib - name: Compiling shell: bash run: | cd build && ninja - - name: Running C++ Tests - shell: bash - run: | - if [[ "${{ runner.os }}" == "Linux" ]] ; then - export XVFB=xvfb-run - fi - cd build && $XVFB ctest --output-on-failure - - name: Running CLI Tests - if: ${{ matrix.scripting == 'lua' }} - shell: bash - run: | - if [[ "${{ runner.os }}" == "Linux" ]] ; then - export XVFB=xvfb-run - fi - export ASEPRITE=$PWD/build/bin/aseprite - cd tests - $XVFB bash run-tests.sh + - uses: actions/upload-artifact@v3 + with: + name: aseprite + path: | + D:/a/aseprite/aseprite/build/bin/data + D:/a/aseprite/aseprite/build/bin/aseprite.exe