Skip to content

Commit 1380a8d

Browse files
authored
Initial commit
0 parents  commit 1380a8d

File tree

7 files changed

+183
-0
lines changed

7 files changed

+183
-0
lines changed

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[*.{yml,md}]
2+
indent_style = space
3+
indent_size = 2
4+
5+
[*.py]
6+
indent_style = tab
7+
indent_size = 4

.github/workflows/auto-build.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Auto build Aseprite
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
auto-build:
12+
name: Auto build Aseprite for Windows x64
13+
runs-on: windows-2022
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Install Ninja
20+
run: |
21+
choco install ninja -y
22+
23+
- name: Install Python requirements
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r requirements.txt
27+
28+
- name: Download Aseprite
29+
run: |
30+
python download.py
31+
32+
- name: Setup MSVC Developer Command Prompt
33+
uses: TheMrMilchmann/setup-msvc-dev@v3
34+
with:
35+
arch: x64
36+
37+
- name: Build Aseprite
38+
run: |
39+
mkdir build
40+
cd build
41+
cmake "../src/aseprite" -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLAF_BACKEND=skia -DSKIA_DIR="../src/skia" -DSKIA_LIBRARY_DIR="../src/skia/out/Release-x64" -DSKIA_LIBRARY="../src/skia/out/Release-x64/skia.lib"
42+
ninja aseprite
43+
copy "C:/Windows/System32/libcrypto-1_1-x64.dll" ./bin
44+
45+
- name: Get version
46+
id: get_version
47+
run: |
48+
$version = Get-Content version.txt
49+
echo "version=$version" >> $env:GITHUB_OUTPUT
50+
51+
- name: Zip Aseprite
52+
run: |
53+
cd build/bin
54+
7z a ../../Aseprite-Windows-x64-${{ steps.get_version.outputs.version }}.zip *
55+
56+
- name: GH Release
57+
uses: softprops/[email protected]
58+
with:
59+
name: Aseprite-Windows-x64-${{ steps.get_version.outputs.version }}
60+
tag_name: ${{ steps.get_version.outputs.version }}
61+
files: |
62+
Aseprite-Windows-x64-${{ steps.get_version.outputs.version }}.zip

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
CMakeLists.txt.user
2+
CMakeCache.txt
3+
CMakeFiles
4+
CMakeScripts
5+
Testing
6+
Makefile
7+
cmake_install.cmake
8+
install_manifest.txt
9+
compile_commands.json
10+
CTestTestfile.cmake
11+
_deps
12+
13+
.venv/
14+
src/
15+
build/
16+
*.txt

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Minh Vương
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Aseprite Auto Build
2+
3+
[![Auto build Aseprite](https://github.com/hardingadonis/aseprite-auto-build/actions/workflows/auto-build.yml/badge.svg)](https://github.com/hardingadonis/aseprite-auto-build/actions/workflows/auto-build.yml)
4+
![GitHub contributors](https://img.shields.io/github/contributors/hardingadonis/aseprite-auto-build)
5+
![GitHub top language](https://img.shields.io/github/languages/top/hardingadonis/aseprite-auto-build)
6+
![GitHub repo size](https://img.shields.io/github/repo-size/hardingadonis/aseprite-auto-build)
7+
![GitHub License](https://img.shields.io/github/license/hardingadonis/aseprite-auto-build)
8+
9+
> Auto build Aseprite via GitHub Actions
10+
11+
> [!IMPORTANT]
12+
> Only supports Windows x64
13+
14+
## Usage:
15+
16+
- Click `Use this template` to create a new repository.
17+
- Wait for the build to complete.
18+
19+
## YouTube:
20+
21+
[![YouTube](https://img.youtube.com/vi/Qx4GaWHLt40/0.jpg)](https://www.youtube.com/watch?v=Qx4GaWHLt40)
22+
23+
## Contributors:
24+
25+
<a href="https://github.com/hardingadonis/aseprite-auto-build/graphs/contributors">
26+
<img src="https://contrib.rocks/image?repo=hardingadonis/aseprite-auto-build" />
27+
</a>
28+
29+
## Licenses:
30+
31+
- [Auto Build Aseprite](https://github.com/hardingadonis/aseprite-auto-build) is under the [MIT license](https://github.com/hardingadonis/aseprite-auto-build/blob/main/LICENSE).

download.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import requests
2+
import os
3+
4+
ASEPRITE_REPOSITORY = 'aseprite/aseprite'
5+
SKIA_REPOSITORY = 'aseprite/skia'
6+
SKIA_RELEASE_FILE_NAME = 'Skia-Windows-Release-x64.zip'
7+
8+
def get_latest_tag_aseprite():
9+
response = requests.get(f'https://api.github.com/repos/{ASEPRITE_REPOSITORY}/releases/latest')
10+
response_json = response.json()
11+
return response_json['tag_name']
12+
13+
def save_aseprite_tag(tag):
14+
with open('version.txt', 'w') as f:
15+
f.write(tag)
16+
17+
def clone_aseprite(tag):
18+
clone_url = f'https://github.com/{ASEPRITE_REPOSITORY}.git'
19+
git_cmd = f'git clone -b {tag} {clone_url} src/aseprite --depth 1'
20+
os.system(git_cmd)
21+
os.system('cd src/aseprite && git submodule update --init --recursive')
22+
23+
def get_latest_tag_skia():
24+
response = requests.get(f'https://api.github.com/repos/{SKIA_REPOSITORY}/releases/latest')
25+
response_json = response.json()
26+
return response_json['tag_name']
27+
28+
def download_skia_for_windows(tag):
29+
download_url = f'https://github.com/{SKIA_REPOSITORY}/releases/download/{tag}/{SKIA_RELEASE_FILE_NAME}'
30+
31+
file_response = requests.get(download_url)
32+
file_response.raise_for_status()
33+
34+
with open(f'src/{SKIA_RELEASE_FILE_NAME}', 'wb') as f:
35+
f.write(file_response.content)
36+
37+
os.system(f'7z x src/{SKIA_RELEASE_FILE_NAME} -osrc/skia')
38+
39+
if __name__ == '__main__':
40+
aseprite_tag = get_latest_tag_aseprite()
41+
clone_aseprite(aseprite_tag)
42+
save_aseprite_tag(aseprite_tag)
43+
44+
skia_tag = get_latest_tag_skia()
45+
download_skia_for_windows(skia_tag)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
requests==2.31.0

0 commit comments

Comments
 (0)