Skip to content

Commit

Permalink
use python for script
Browse files Browse the repository at this point in the history
  • Loading branch information
hardingadonis committed Apr 4, 2024
1 parent c3908a3 commit 334cb40
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[*.{yml,md}]
indent_style = space
indent_size = 2
indent_size = 2

[*.py]
indent_style = tab
indent_size = 4
10 changes: 5 additions & 5 deletions .github/workflows/auto-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get Aseprite version
id: get_version
- name: Install Python requirements
run: |
echo "version=$(./get_version.bat)" >> $GITHUB_OUTPUT
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Print Aseprite version
- name: Download & Build Aseprite
run: |
echo "Aseprite version: ${{ steps.get_version.outputs.version }}"
python main.py
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps

.venv/
src/
3 changes: 0 additions & 3 deletions get_version.bat

This file was deleted.

19 changes: 19 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import requests
import os

ASEPRITE_REPOSITORY = 'aseprite/aseprite'

def get_latest_tag_aseprite():
response = requests.get(f'https://api.github.com/repos/{ASEPRITE_REPOSITORY}/releases/latest')
response_json = response.json()
return response_json['tag_name']

def clone_aseprite(tag):
clone_url = f'https://github.com/{ASEPRITE_REPOSITORY}.git'
git_cmd = f'git clone -b {tag} {clone_url} src/aseprite --depth 1'
os.system(git_cmd)
os.system('cd src/aseprite && git submodule update --init --recursive')

if __name__ == '__main__':
tag = get_latest_tag_aseprite()
clone_aseprite(tag)
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requests==2.31.0

0 comments on commit 334cb40

Please sign in to comment.