Files
corestate/CI_CD_SETUP.md

10 KiB

🚀 CoreState v2.0 - CI/CD Pipeline Setup Complete!

Author: Wiktor (overspend1) Repository: https://github.com/overspend1/corestate


What's Been Added

1. Author Attribution

All project files now properly credit Wiktor (overspend1) as the author:

  • LICENSE - MIT License with copyright
  • module/module.prop - Author field (already present)
  • module/native/AUTHOR.h - Header file with author info
  • CoreStateApplication.kt - Android app entry point with author comments
  • README.md - Already credits Wiktor/overspend1

2. Complete CI/CD Pipeline

New comprehensive workflow: .github/workflows/complete-build-release.yml


🎯 CI/CD Pipeline Features

📱 Android APK Build

What it builds:

  • Debug APK - For testing and development
  • Release APK - Production-ready build

Features:

  • JDK 17 setup
  • Gradle caching for faster builds
  • Version tagging from git commits/tags
  • SHA256 checksum generation
  • Automated artifact upload
  • 30-day artifact retention

Output:

CoreState-v2.0.0-{commit}-debug.apk
CoreState-v2.0.0-{commit}-release.apk
checksums.txt

📦 KernelSU Module Build

What it builds:

  • arm64-v8a - For 64-bit ARM devices (most modern phones)
  • x86_64 - For x86_64 emulators/devices

Build Process:

  1. Downloads Android NDK r26b
  2. Cross-compiles native components for each architecture
  3. Creates proper KernelSU module structure
  4. Generates flashable ZIP files
  5. Includes installer scripts and metadata

Module Structure:

CoreState-Module-v2.0.0-arm64-v8a.zip
├── META-INF/
│   └── com/google/android/
│       ├── update-binary (installer script)
│       └── updater-script
├── module.prop (module metadata)
├── service.sh (boot service)
├── system/
│   └── lib64/ (native libraries)
└── README.md (installation guide)

Features:

  • Android NDK cross-compilation
  • CMake + Ninja build system
  • Proper KernelSU installer scripts
  • Service scripts for boot initialization
  • SHA256 checksums
  • Comprehensive module README

Output:

CoreState-Module-v2.0.0-arm64-v8a.zip
CoreState-Module-v2.0.0-x86_64.zip
module-checksums-{arch}.txt

📋 Build Summary & Release

Generated artifacts:

  • Build summary with metadata
  • Installation instructions
  • SHA256 checksums for verification
  • Automated release notes

GitHub Release (on tags): When you push a git tag like v2.0.0, the workflow automatically:

  1. Builds all artifacts
  2. Creates a GitHub Release
  3. Attaches all APKs and module ZIPs
  4. Generates release notes
  5. Includes checksums

🔄 Workflow Triggers

The CI/CD pipeline runs on:

  1. Push to branches:

    • main
    • develop
    • claude/** (any claude branch)
  2. Pull requests to:

    • main
  3. Git tags:

    • v* (e.g., v2.0.0, v2.0.1, etc.)
    • Triggers full build + GitHub Release
  4. Manual trigger:

    • Via GitHub Actions UI
    • Choose debug or release build type

🎬 How to Use

Automatic Build (Push)

Simply push your code:

git push origin main

The workflow will automatically:

  1. Build both debug and release APKs
  2. Build KernelSU modules for all architectures
  3. Upload all artifacts
  4. Generate build summary

Create a Release (Tags)

To create an official release:

# Tag the release
git tag -a v2.0.0 -m "CoreState v2.0.0 - Complete Release"

# Push the tag
git push origin v2.0.0

This will:

  1. Build all artifacts
  2. Create GitHub Release at: https://github.com/overspend1/corestate/releases/tag/v2.0.0
  3. Attach all APKs and module ZIPs
  4. Generate release notes
  5. Include checksums

Manual Build (GitHub Actions)

  1. Go to: https://github.com/overspend1/corestate/actions
  2. Select "Complete Build & Release" workflow
  3. Click "Run workflow"
  4. Choose branch and build type
  5. Click "Run workflow" button

📥 Downloading Artifacts

From GitHub Actions

  1. Go to: https://github.com/overspend1/corestate/actions
  2. Click on a completed workflow run
  3. Scroll to "Artifacts" section
  4. Download:
    • corestate-android-debug-apk
    • corestate-android-release-apk
    • corestate-module-arm64-v8a
    • corestate-module-x86_64
    • build-summary

From GitHub Releases

  1. Go to: https://github.com/overspend1/corestate/releases
  2. Click on the latest release
  3. Download files from "Assets" section
  4. Verify checksums using provided checksums.txt

🔐 Verifying Checksums

After downloading artifacts:

# For APK
sha256sum -c checksums.txt

# For Module
sha256sum -c module-checksums-arm64-v8a.txt

📦 Installation Instructions

Android APK

  1. Download the APK (debug for testing, release for production)
  2. Transfer to your Android device
  3. Enable "Install from unknown sources" in Settings
  4. Tap the APK to install
  5. Grant required permissions

KernelSU Module

  1. Ensure you have KernelSU installed on your device
  2. Download the module ZIP for your architecture:
    • arm64-v8a - Most modern Android phones
    • x86_64 - Emulators and x86 devices
  3. Open KernelSU Manager app
  4. Tap the "+" button
  5. Select "Install from storage"
  6. Choose the downloaded ZIP file
  7. Wait for installation to complete
  8. Reboot your device
  9. Module will be active after reboot

🛠️ Build Details

Android APK Build

Environment:

  • Ubuntu Latest
  • JDK 17 (Temurin)
  • Gradle with 4GB heap
  • Gradle caching enabled

Build Commands:

# Debug
./gradlew :apps:android:androidApp:assembleDebug

# Release
./gradlew :apps:android:androidApp:assembleRelease

Build Time: ~5-10 minutes


KernelSU Module Build

Environment:

  • Ubuntu Latest
  • Android NDK r26b
  • CMake + Ninja
  • Cross-compilation toolchains

Build Commands:

# Configure
cmake .. \
  -DCMAKE_TOOLCHAIN_FILE=$NDK_HOME/build/cmake/android.toolchain.cmake \
  -DANDROID_ABI=arm64-v8a \
  -DANDROID_PLATFORM=android-26 \
  -DCMAKE_BUILD_TYPE=Release \
  -GNinja

# Build
ninja -j$(nproc)

# Package
zip -r CoreState-Module-v2.0.0-arm64-v8a.zip .

Build Time: ~3-5 minutes per architecture


📊 Artifact Information

APK Details

File Size Platform Purpose
CoreState-*-debug.apk ~15-20 MB Android 8.0+ Development/Testing
CoreState-*-release.apk ~12-18 MB Android 8.0+ Production Use

Module Details

File Size Architecture Compatibility
CoreState-Module-*-arm64-v8a.zip ~5-10 MB ARM64 Most Android phones
CoreState-Module-*-x86_64.zip ~5-10 MB x86_64 Emulators/x86 devices

🔍 Troubleshooting

Build Fails

Check the workflow logs:

  1. Go to GitHub Actions
  2. Click on the failed workflow run
  3. Expand the failed job
  4. Review error messages

Common issues:

  • Gradle build errors - Check build.gradle.kts syntax
  • NDK compilation errors - Verify CMakeLists.txt
  • Module packaging errors - Check module structure

APK Won't Install

  • Enable "Install from unknown sources"
  • Check Android version (8.0+ required)
  • Verify APK checksum matches
  • Try debug build first

Module Won't Flash

  • Ensure KernelSU is properly installed
  • Check device architecture matches module
  • Verify ZIP file integrity with checksum
  • Try flashing via KernelSU Manager app

📈 Build Status

Current workflow status can be viewed at: https://github.com/overspend1/corestate/actions

Build badges:

  • Complete Build

🤝 Contributing

When contributing, the CI/CD pipeline will automatically:

  1. Build your changes on push
  2. Run on pull requests to main
  3. Verify builds pass before merge
  4. Generate artifacts for testing

📝 Workflow Structure

Jobs:
├── build-android-apk (debug & release)
│   ├── Setup JDK 17
│   ├── Cache Gradle
│   ├── Build APK
│   ├── Generate checksums
│   └── Upload artifacts

├── build-kernelsu-module (arm64 & x86_64)
│   ├── Install NDK
│   ├── Cross-compile native code
│   ├── Package flashable ZIP
│   ├── Generate checksums
│   └── Upload artifacts

├── create-release-summary
│   ├── Download all artifacts
│   ├── Generate build summary
│   └── Upload summary

├── create-github-release (on tags only)
│   ├── Download artifacts
│   ├── Generate release notes
│   └── Create GitHub Release

└── build-status
    └── Report overall status

🎉 Success!

Your CoreState v2.0 project now has a complete, production-ready CI/CD pipeline that:

Builds Android APK (debug & release) Builds KernelSU Module (multi-arch) Generates checksums for security Creates flashable module ZIPs Automates GitHub Releases Includes proper author attribution

All builds are credited to: Wiktor (overspend1)


🚀 Next Steps

  1. Push a commit to trigger the workflow
  2. Check GitHub Actions to see builds in progress
  3. Download artifacts from completed workflows
  4. Create a tag (e.g., v2.0.0) to create an official release
  5. Test the builds on your device

📞 Support


Built with ❤️ by Wiktor (overspend1)

CoreState v2.0 - The World's First Android-Managed Enterprise Backup System