forked from ColdWindScholar/GSIMaker
-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (68 loc) · 2.66 KB
/
Copy pathgsimaker.yml
File metadata and controls
84 lines (68 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: OEM GSI Maker
on:
workflow_dispatch:
inputs:
rom_url:
description: 'Firmware download link'
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Debloat the OS
run: |
export DEBIAN_FRONTEND=noninteractive
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
echo "Storage spaces before debloat/clean-up:"
df -h
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL /usr/local/share/powershell /usr/share/swift || true
sudo docker image prune --all --force
echo "some directories deleted"
# Remove large unwanted packages
sudo apt-get purge -y \
aria2 ansible azure-cli shellcheck rpm xorriso zsync \
esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \
google-cloud-sdk imagemagick \
libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \
mercurial apt-transport-https mono-complete libmysqlclient \
unixodbc-dev yarn chrpath libssl-dev libxft-dev \
libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \
snmp pollinate libpq-dev postgresql-client powershell ruby-full \
sphinxsearch subversion mongodb-org microsoft-edge-stable || true
# Regex-based purges (for bulk families like mysql, php, dotnet)
sudo apt-get purge -y $(dpkg-query -W -f='${binary:Package}\n' | grep -E '^mysql|^php|^dotnet') || true
# Clean up
sudo apt-get autoremove -y
sudo apt-get autoclean -y
echo "some packages purged"
echo "Storage spaces after debloat/clean-up:"
df -h
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y e2fsprogs android-sdk-libsparse-utils python3-pip brotli
pip3 install -r requirements.txt
pip3 install pycryptodome
- name: Download firmware
run: |
mkdir -p roms
wget -O "roms/rom.zip" "${{ inputs.rom_url }}"
- name: Run GSIMaker
run: |
python3 cgsi.py
- name: Package output
run: |
cd IMG/out
zip -r gsi_output.zip .
- name: Upload GSI
uses: actions/upload-artifact@v4
with:
name: gsi-output
path: IMG/out/gsi_output.zip