diff --git a/.editorconfig b/.editorconfig index 1528162..f46ac95 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,7 @@ [*.{yml,md}] indent_style = space -indent_size = 2 \ No newline at end of file +indent_size = 2 + +[*.py] +indent_style = tab +indent_size = 4 \ No newline at end of file diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index ce69aac..79b20e7 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -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 diff --git a/.gitignore b/.gitignore index 46f42f8..b51ece2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ install_manifest.txt compile_commands.json CTestTestfile.cmake _deps + +.venv/ +src/ \ No newline at end of file diff --git a/get_version.bat b/get_version.bat deleted file mode 100644 index ebdaa6b..0000000 --- a/get_version.bat +++ /dev/null @@ -1,3 +0,0 @@ -set ASEPRITE_VERSION=v1.3.5 - -echo %ASEPRITE_VERSION% \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..5db713d --- /dev/null +++ b/main.py @@ -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) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..077c95d --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requests==2.31.0 \ No newline at end of file