-
Notifications
You must be signed in to change notification settings - Fork 11
286 lines (254 loc) · 10.4 KB
/
build-release.yml
File metadata and controls
286 lines (254 loc) · 10.4 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
name: Build and Release
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
prepare:
name: Prepare release metadata
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.meta.outputs.tag_name }}
should_release: ${{ steps.meta.outputs.should_release }}
steps:
- uses: actions/checkout@v4
- name: Determine release tag
id: meta
shell: bash
run: |
set -euo pipefail
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
tag_name="${GITHUB_REF##refs/tags/}"
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
echo "should_release=true" >> "$GITHUB_OUTPUT"
exit 0
fi
version=$(python -c "from version import get_version; print(get_version())")
tag_name="v${version}"
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
git fetch --tags --quiet
if git show-ref --tags --quiet "refs/tags/${tag_name}"; then
echo "should_release=false" >> "$GITHUB_OUTPUT"
else
echo "should_release=true" >> "$GITHUB_OUTPUT"
fi
build:
needs: prepare
if: needs.prepare.outputs.should_release == 'true'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
artifact_name: android-bloatware-remover.exe
asset_name: android-bloatware-remover-windows.exe
- os: ubuntu-latest
artifact_name: android-bloatware-remover
asset_name: android-bloatware-remover-linux
- os: macos-latest
artifact_name: android-bloatware-remover
asset_name: android-bloatware-remover-macos
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Test Python application first
run: |
echo "Testing Python application..."
python main.py --test &
sleep 5
pkill -f "python main.py" || true
echo "Python test completed"
shell: bash
- name: Build with PyInstaller (Cross-platform)
run: |
echo "Building with PyInstaller..."
if [ "${{ matrix.os }}" = "windows-latest" ]; then
pyinstaller --onefile --console --name android-bloatware-remover main.py \
--add-data "core;core" \
--add-data "README.md;." \
--hidden-import core.bloatware_remover \
--hidden-import device_detector \
--hidden-import version \
--hidden-import Samsung.samsung_remover \
--hidden-import Xiaomi.xiaomi_remover \
--hidden-import Oppo.oppo_remover \
--hidden-import Vivo.vivo_remover \
--hidden-import Realme.realme_remover \
--hidden-import Tecno.tecno_remover \
--hidden-import OnePlus.oneplus_remover \
--hidden-import Huawei.huawei_remover \
--hidden-import Honor.honor_remover \
--hidden-import Motorola.motorola_remover \
--hidden-import Nothing.nothing_remover \
--clean --noconfirm
else
pyinstaller --onefile --console --name android-bloatware-remover main.py \
--add-data "core:core" \
--add-data "README.md:." \
--hidden-import core.bloatware_remover \
--hidden-import device_detector \
--hidden-import version \
--hidden-import Samsung.samsung_remover \
--hidden-import Xiaomi.xiaomi_remover \
--hidden-import Oppo.oppo_remover \
--hidden-import Vivo.vivo_remover \
--hidden-import Realme.realme_remover \
--hidden-import Tecno.tecno_remover \
--hidden-import OnePlus.oneplus_remover \
--hidden-import Huawei.huawei_remover \
--hidden-import Honor.honor_remover \
--hidden-import Motorola.motorola_remover \
--hidden-import Nothing.nothing_remover \
--clean --noconfirm
fi
echo "Build completed. Checking dist directory:"
ls -la dist/
shell: bash
- name: Test executable
run: |
echo "Testing executable..."
if [ "${{ matrix.os }}" = "windows-latest" ]; then
if [ -f "dist/android-bloatware-remover.exe" ]; then
echo "Windows executable found"
timeout 10s dist/android-bloatware-remover.exe --test || echo "Test completed"
else
echo "Windows executable not found!"
exit 1
fi
else
if [ -f "dist/android-bloatware-remover" ]; then
echo "Unix executable found"
chmod +x dist/android-bloatware-remover
timeout 10s dist/android-bloatware-remover --test || echo "Test completed"
else
echo "Unix executable not found!"
exit 1
fi
fi
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: dist/${{ matrix.artifact_name }}
release:
needs: [prepare, build]
runs-on: ubuntu-latest
if: needs.prepare.outputs.should_release == 'true'
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: List downloaded artifacts
run: |
echo "Current directory contents:"
ls -la
echo "Looking for executables:"
find . -name "*android-bloatware-remover*" -type f
echo "Preparing files for release..."
- name: Prepare release files
run: |
mkdir -p release
if [ -f "android-bloatware-remover-windows.exe/android-bloatware-remover.exe" ]; then
cp "android-bloatware-remover-windows.exe/android-bloatware-remover.exe" "release/android-bloatware-remover-windows.exe"
fi
if [ -f "android-bloatware-remover-linux/android-bloatware-remover" ]; then
cp "android-bloatware-remover-linux/android-bloatware-remover" "release/android-bloatware-remover-linux"
fi
if [ -f "android-bloatware-remover-macos/android-bloatware-remover" ]; then
cp "android-bloatware-remover-macos/android-bloatware-remover" "release/android-bloatware-remover-macos"
fi
echo "Release files prepared:"
ls -la release/
- name: Generate file hashes
run: |
cd release
echo "# File Verification Hashes" > HASHES.md
echo "" >> HASHES.md
echo "Use these SHA256 hashes to verify file integrity:" >> HASHES.md
echo "" >> HASHES.md
for file in *; do
if [ -f "$file" ] && [ "$file" != "HASHES.md" ]; then
hash=$(sha256sum "$file" | cut -d' ' -f1)
size=$(stat -c%s "$file")
echo "**$file**" >> HASHES.md
echo "- SHA256: \`$hash\`" >> HASHES.md
printf -- "- Size: %s bytes\n" "$size" >> HASHES.md
echo "" >> HASHES.md
fi
done
echo "## How to verify:" >> HASHES.md
echo "" >> HASHES.md
echo "**Windows (PowerShell):**" >> HASHES.md
echo "\`\`\`powershell" >> HASHES.md
echo "Get-FileHash -Algorithm SHA256 android-bloatware-remover-windows.exe" >> HASHES.md
echo "\`\`\`" >> HASHES.md
echo "" >> HASHES.md
echo "**Linux/Mac:**" >> HASHES.md
echo "\`\`\`bash" >> HASHES.md
echo "sha256sum android-bloatware-remover-linux" >> HASHES.md
echo "shasum -a 256 android-bloatware-remover-macos" >> HASHES.md
echo "\`\`\`" >> HASHES.md
echo "Generated hashes:"
cat HASHES.md
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.prepare.outputs.tag_name }}
name: Release ${{ needs.prepare.outputs.tag_name }}
body: |
## Android Bloatware Remover ${{ needs.prepare.outputs.tag_name }}
Standalone executables for Windows, Linux, and macOS.
### Windows Defender False Positive
Windows Defender may flag the executable as a virus. This is a **false positive** common with PyInstaller executables. The tool is completely safe - all source code is open and auditable. See [SECURITY.md](https://github.com/PixelCode01/UIBloatwareRegistry/blob/main/SECURITY.md) for details and solutions.
### Download Instructions:
- **Windows**: Download `android-bloatware-remover-windows.exe`
- **Linux**: Download `android-bloatware-remover-linux`
- **macOS**: Download `android-bloatware-remover-macos`
- **Verification**: Download `HASHES.md` to verify file integrity
### Usage:
1. Download the appropriate executable for your operating system
2. Make sure ADB is installed and in your PATH
3. Enable USB debugging on your Android device
4. Connect your device and run the executable
### Supported Devices:
- Samsung (One UI)
- Xiaomi/Redmi/POCO (MIUI)
- Oppo (ColorOS)
- Vivo/iQOO (FunTouch OS)
- Realme (Realme UI)
- Tecno (HiOS)
- OnePlus (OxygenOS)
- Huawei (EMUI/HarmonyOS)
- Honor (Magic UI)
- Motorola (My UX)
- Nothing (Nothing OS)
### Test Mode:
Run with `--test` flag to try without a connected device.
### Alternative Installation:
If you prefer to avoid the executable, run from Python source:
```bash
git clone https://github.com/PixelCode01/UIBloatwareRegistry.git
cd UIBloatwareRegistry
python main.py
```
draft: false
prerelease: false
files: release/*
fail_on_unmatched_files: false