Skip to content

Commit

Permalink
allow to specify which version to build
Browse files Browse the repository at this point in the history
  • Loading branch information
mmozeiko committed Nov 23, 2024
1 parent 6abbe5b commit 1cd9db3
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 30 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/aseprite.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@

name: aseprite

on: workflow_dispatch
on:
workflow_dispatch:
inputs:
version:
description: "Version to build, leave empty for latest"
required: false

jobs:
build:
Expand All @@ -15,6 +20,8 @@ jobs:
id: build
shell: cmd
run: call build.cmd
env:
ASEPRITE_VERSION: ${{ github.event.inputs.version }}

- name: Archive
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.zip
skia
skia*
build
aseprite*
aseprite*
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Step by step guide to build binaries for latest version:

# 3. Open `aseprite` workflow, and click `Run workflow`

Optionally specify which version of Asprite to build (e.g. v1.3.10) in text field.
Leave it empty to build latest released version.
See list of available Aseprite versions [here][versions].

![step3](images/step3.png)

# 4. Wait ~13min for build to finish, then open latest run
Expand All @@ -26,3 +30,4 @@ Step by step guide to build binaries for latest version:
For building newer aseprite version repeat steps 3 to 5.

[Aseprite]: https://github.com/aseprite/aseprite
[versions]: https://github.com/aseprite/aseprite/tags
58 changes: 31 additions & 27 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,19 @@ where /q ninja.exe || (

rem *** fetch latest release version

for /F "delims=" %%v in ('"curl -sfL https://api.github.com/repos/aseprite/aseprite/releases/latest | jq .tag_name -r"') do (
set ASEPRITE_VERSION=%%v
if "%ASEPRITE_VERSION%" equ "" (
for /F "delims=" %%v in ('"curl -sfL https://api.github.com/repos/aseprite/aseprite/releases/latest | jq .tag_name -r"') do (
set ASEPRITE_VERSION=%%v
)
)
echo building %ASEPRITE_VERSION%

if "%ASEPRITE_VERSION:beta=%" neq "%ASEPRITE_VERSION%" (
set SKIA_VERSION=m124-08a5439a6b
) else (
set SKIA_VERSION=m102-861e4743af
)


rem **** clone aseprite repo

Expand All @@ -67,15 +75,11 @@ python -c "v = open('aseprite/src/ver/CMakeLists.txt').read(); open('aseprite/sr

rem *** download skia

if not exist skia (
mkdir skia
pushd skia
if "%ASEPRITE_VERSION:beta=%" neq "%ASEPRITE_VERSION%" (
curl -sfLO https://github.com/aseprite/skia/releases/download/m124-08a5439a6b/Skia-Windows-Release-x64.zip || echo failed to download skia && exit /b 1
) else (
curl -sfLO https://github.com/aseprite/skia/releases/download/m102-861e4743af/Skia-Windows-Release-x64.zip || echo failed to download skia && exit /b 1
)
7z x -y Skia-Windows-Release-x64.zip
if not exist skia-%SKIA_VERSION% (
mkdir skia-%SKIA_VERSION%
pushd skia-%SKIA_VERSION%
curl -sfLO https://github.com/aseprite/skia/releases/download/%SKIA_VERSION%/Skia-Windows-Release-x64.zip || echo failed to download skia && exit /b 1
%SZIP% x -y Skia-Windows-Release-x64.zip
popd
)

Expand All @@ -85,22 +89,22 @@ rem *** build aseprite
if exist build rd /s /q build

set LINK=opengl32.lib
cmake ^
-G Ninja ^
-S aseprite ^
-B build ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW ^
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW ^
-DCMAKE_POLICY_DEFAULT_CMP0092=NEW ^
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded ^
-DENABLE_CCACHE=OFF ^
-DOPENSSL_USE_STATIC_LIBS=TRUE ^
-DLAF_BACKEND=skia ^
-DSKIA_DIR=%CD%\skia ^
-DSKIA_LIBRARY_DIR=%CD%\skia\out\Release-x64 ^
-DSKIA_OPENGL_LIBRARY= || echo failed to configure build && exit /b 1
ninja -C build || echo "build failed" && exit /b 1
cmake.exe ^
-G Ninja ^
-S aseprite ^
-B build ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW ^
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW ^
-DCMAKE_POLICY_DEFAULT_CMP0092=NEW ^
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded ^
-DENABLE_CCACHE=OFF ^
-DOPENSSL_USE_STATIC_LIBS=TRUE ^
-DLAF_BACKEND=skia ^
-DSKIA_DIR=%CD%\skia-%SKIA_VERSION% ^
-DSKIA_LIBRARY_DIR=%CD%\skia-%SKIA_VERSION%\out\Release-x64 ^
-DSKIA_OPENGL_LIBRARY= || echo failed to configure build && exit /b 1
ninja.exe -C build || echo build failed && exit /b 1


rem *** create output folder
Expand Down
Binary file modified images/step3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1cd9db3

Please sign in to comment.