From fe1b6b13fb331de4deb8d3b739308aa94080815b Mon Sep 17 00:00:00 2001 From: CyberArtemio <156206062+cyberartemio@users.noreply.github.com> Date: Sat, 10 Feb 2024 13:09:49 +0100 Subject: [PATCH] added build action --- .github/workflows/build.yml | 47 +++++++++++++++++++++++++++++++++++++ .gitignore | 3 ++- builder.py | 7 ++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml create mode 100644 builder.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f30f887 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +on: + workflow_dispatch: +jobs: + build-assets: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Python v3.11 + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Install dependencies + run: pip3 install Pillow heatshrink2 + - name: Download XFW asset_packer.py + run: wget https://raw.githubusercontent.com/Flipper-XFW/Xtreme-Firmware/dev/scripts/asset_packer.py + - name: Build assets + run: python3 builder.py + - name: Pack for Xtreme FW + run: | + cd asset_packs + zip -r xtreme_pirates_asset_pack.zip Pirates + mv xtreme_pirates_asset_pack.zip ../build + - name: Pack for Rogue Master FW + run: | + cd asset_packs/Pirates/Anims + mv manifest.txt manifest_pirates.txt + zip -r roguemaster_pirates_asset_pack.zip . + mv roguemaster_pirates_asset_pack.zip ../../../build + mv manifest_pirates.txt manifest.txt + - name: Pack for Unleashed FW + run: | + cd asset_packs/Pirates/Anims + sed -i 's/Max level: 30/Max level: 3/g' manifest.txt + cd .. + mv Anims dolphin + zip -r unleashed_pirates_asset_pack.zip dolphin + mv unleashed_pirates_asset_pack.zip ../../build + - name: Pack for Original FW + run: cp build/unleashed_pirates_asset_pack.zip build/official_pirates_asset_pack.zip + - name: Commit and push + run: | + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + git add build + git commit -m "build asset packs" + git push origin main \ No newline at end of file diff --git a/.gitignore b/.gitignore index ca97895..b9c73d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ raw_files .venv -asset_packs \ No newline at end of file +asset_packs +asset_packer.py \ No newline at end of file diff --git a/builder.py b/builder.py new file mode 100644 index 0000000..f4984ab --- /dev/null +++ b/builder.py @@ -0,0 +1,7 @@ +#!/usr/bin/python3 +from asset_packer import pack +import pathlib + +if __name__ == "__main__": + here = pathlib.Path(__file__).absolute().parent + pack(here, here / "asset_packs", logger=print) \ No newline at end of file