Simplify and improve GitHub Actions workflow reliability #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| 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: Create PyInstaller spec file | |
| run: | | |
| echo "Creating spec file..." | |
| python build_spec.py | |
| echo "Spec file created. Contents:" | |
| cat android-bloatware-remover.spec | |
| - name: Build with PyInstaller | |
| run: | | |
| echo "Building with PyInstaller..." | |
| pyinstaller android-bloatware-remover.spec --clean --noconfirm | |
| echo "Build completed. Checking dist directory:" | |
| ls -la dist/ | |
| - 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" | |
| # Just check if it starts without hanging | |
| 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 | |
| # Just check if it starts without hanging | |
| 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: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| 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 | |
| # Copy and rename files for 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: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| body: | | |
| ## Android Bloatware Remover ${{ github.ref_name }} | |
| Standalone executables for Windows, Linux, and macOS. | |
| ### Download Instructions: | |
| - **Windows**: Download `android-bloatware-remover-windows.exe` | |
| - **Linux**: Download `android-bloatware-remover-linux` | |
| - **macOS**: Download `android-bloatware-remover-macos` | |
| ### 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. | |
| draft: false | |
| prerelease: false | |
| files: release/* | |
| fail_on_unmatched_files: false |