Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dedsecproyt committed Sep 21, 2023
0 parents commit 7af9b46
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Xtreme Firmware Builder

on:
workflow_dispatch:
inputs:
Uninstall_Games:
description: 'Uninstall Games?'
required: true
default: 'yes'
type: string
Uninstall_Apps:
description: 'Uninstall Apps?'
required: true
default: 'no'
type: string

jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.FLIPPER_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y git build-essential
- name: Download firmware
run: |
git clone https://github.com/Flipper-XFW/Xtreme-Firmware
- name: Run Uninstall_Games
if: ${{ github.event.inputs.Uninstall_Games == 'yes' }}
run: |
chmod +x Uninstall_Games.sh
./Uninstall_Games.sh
- name: Run Uninstall_Apps
if: ${{ github.event.inputs.Uninstall_Apps == 'yes' }}
run: |
chmod +x Uninstall_Apps.sh
./Uninstall_Apps.sh
- name: Compiling Flipper Firmware
run: |
cd Xtreme-Firmware
./fbt COMPACT=1 DEBUG=0 updater_package
- name: Upload Asset
uses: softprops/action-gh-release@v1
with:
files: |
Xtreme-Firmware/dist/f7-C/*.tgz
Xtreme-Firmware/dist/f7-C/*.dfu
name: Xtreme Firmware
tag_name: main
30 changes: 30 additions & 0 deletions Uninstall_Apps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
folders_to_delete=("" "")
deleted_folders=()
not_deleted_folders=()

# Deleting Folders
for folder in "${folders_to_delete[@]}"; do
if [ -d "Xtreme-Firmware/applications/external/$folder" ]; then
rm -rf "Xtreme-Firmware/applications/external/$folder"
deleted_folders+=("$folder")
else
not_deleted_folders+=("$folder")
fi
done

# Display deleted folders
if [ ${#deleted_folders[@]} -gt 0 ]; then
deleted_folders_str=$(IFS=" "; echo "${deleted_folders[*]}")
echo "Deleted Apps: $deleted_folders_str"
else
echo "No folders were deleted"
fi

# Display folders that were not deleted
if [ ${#not_deleted_folders[@]} -gt 0 ]; then
not_deleted_folders_str=$(IFS=" "; echo "${not_deleted_folders[*]}")
echo "Not deleted folders: $not_deleted_folders_str"
else
echo "All folders were deleted"
fi
30 changes: 30 additions & 0 deletions Uninstall_Games.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
folders_to_delete=("doom" "zombiez" "arkanoid" "tictactoe_game" "tetris_game" "minesweeper" "heap_defence_game" "game15" "solitaire" "blackjack" "game_2048" "bomberduck" "asteroids" "chess" "pong" "jetpack_joyride" "multi_dice" "reversi" "rubiks_cube_scrambler" "scorched_tanks" "snake_2" "t_rex_runner" "tama_p1" "tanksgame" "videopoker" "yatzee" "4inrow" "rootoflife" "simonsays" "game_of_life" "slots" )
deleted_folders=()
not_deleted_folders=()

# Deleting Folders
for folder in "${folders_to_delete[@]}"; do
if [ -d "Xtreme-Firmware/applications/external/$folder" ]; then
rm -rf "Xtreme-Firmware/applications/external/$folder"
deleted_folders+=("$folder")
else
not_deleted_folders+=("$folder")
fi
done

# Display deleted folders
if [ ${#deleted_folders[@]} -gt 0 ]; then
deleted_folders_str=$(IFS=" "; echo "${deleted_folders[*]}")
echo "Deleted Games: $deleted_folders_str"
else
echo "No folders were deleted"
fi

# Display folders that were not deleted
if [ ${#not_deleted_folders[@]} -gt 0 ]; then
not_deleted_folders_str=$(IFS=" "; echo "${not_deleted_folders[*]}")
echo "Not deleted folders: $not_deleted_folders_str"
else
echo "All folders were deleted"
fi

0 comments on commit 7af9b46

Please sign in to comment.