| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- name: Build and Release GKI Kernels
- permissions:
- contents: write # Allow writing to repository contents (for pushing tags)
- actions: write # Allows triggering actions
-
- on:
- workflow_dispatch:
- inputs:
- make_release:
- description: 'Do you want to create a release?'
- required: true
- type: boolean
- default: false
- runner:
- description: "Choose runner"
- required: true
- type: choice
- options:
- - ubuntu-22.04
- - ubuntu-22.04-local
- default: ubuntu-22.04
- lto_type:
- description: "Choose LTO type (full will not run on basic runners)"
- required: true
- type: choice
- options:
- - full
- - thin
- - none
- default: thin
- kernelsu_variant:
- description: "Choose KernelSU"
- required: true
- type: choice
- options:
- - Official
- - Next
- - Placeholder
- default: Next
- kernelsu_branch:
- description: "Choose ksu branch"
- required: true
- type: choice
- options:
- - Stable
- - Dev
- - Other
- default: Stable
- kernelsu_branch_other:
- description: "If 'Other' is selected, specify your custom branch"
- required: false
- type: string # This input is required if 'Other' is chosen
- default: "" # Default is empty, but can be filled in if 'Other' is selected
- jobs:
- build-kernel-a12-5-10:
- uses: ./.github/workflows/kernel-a12-5.10.yml
- secrets: inherit
- with:
- runner: ${{ inputs.runner }}
- lto_type: ${{ inputs.lto_type }}
- kernelsu_variant: ${{ inputs.kernelsu_variant }}
- kernelsu_branch: ${{ inputs.kernelsu_branch }}
- kernelsu_branch_other: ${{ inputs.kernelsu_branch_other }}
- build-kernel-a13-5-10:
- uses: ./.github/workflows/kernel-a13-5.10.yml
- secrets: inherit
- with:
- runner: ${{ inputs.runner }}
- lto_type: ${{ inputs.lto_type }}
- kernelsu_variant:: ${{ inputs.kernelsu_variant }}
- kernelsu_branch: ${{ inputs.kernelsu_branch }}
- kernelsu_branch_other: ${{ inputs.kernelsu_branch_other }}
- build-kernel-a13-5-15:
- uses: ./.github/workflows/kernel-a13-5.15.yml
- secrets: inherit
- with:
- runner: ${{ inputs.runner }}
- lto_type: ${{ inputs.lto_type }}
- kernelsu_variant:: ${{ inputs.kernelsu_variant }}
- kernelsu_branch: ${{ inputs.kernelsu_branch }}
- kernelsu_branch_other: ${{ inputs.kernelsu_branch_other }}
- build-kernel-a14-5-15:
- uses: ./.github/workflows/kernel-a14-5.15.yml
- secrets: inherit
- with:
- runner: ${{ inputs.runner }}
- lto_type: ${{ inputs.lto_type }}
- kernelsu_variant:: ${{ inputs.kernelsu_variant }}
- kernelsu_branch: ${{ inputs.kernelsu_branch }}
- kernelsu_branch_other: ${{ inputs.kernelsu_branch_other }}
- build-kernel-a14-6-1:
- uses: ./.github/workflows/kernel-a14-6.1.yml
- secrets: inherit
- with:
- runner: ${{ inputs.runner }}
- lto_type: ${{ inputs.lto_type }}
- kernelsu_variant:: ${{ inputs.kernelsu_variant }}
- kernelsu_branch: ${{ inputs.kernelsu_branch }}
- kernelsu_branch_other: ${{ inputs.kernelsu_branch_other }}
- build-kernel-a15-6-6:
- uses: ./.github/workflows/kernel-a15-6.6.yml
- secrets: inherit
- with:
- runner: ${{ inputs.runner }}
- lto_type: ${{ inputs.lto_type }}
- kernelsu_variant:: ${{ inputs.kernelsu_variant }}
- kernelsu_branch: ${{ inputs.kernelsu_branch }}
- kernelsu_branch_other: ${{ inputs.kernelsu_branch_other }}
- trigger-release:
- runs-on: ubuntu-latest
- needs:
- - build-kernel-a12-5-10
- - build-kernel-a13-5-10
- - build-kernel-a13-5-15
- - build-kernel-a14-5-15
- - build-kernel-a14-6-1
- - build-kernel-a15-6-6
- if: ${{ inputs.make_release }}
- env:
- REPO_OWNER: WildPlusKernel
- REPO_NAME: GKI_KernelSU_SUSFS
- GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
- RELEASE_NAME: "*TEST BUILD* GKI Kernels With KernelSU Next & SUSFS v1.5.5 *TEST BUILD*"
- RELEASE_NOTES: |
- This release contains KernelSU Next and SUSFS v1.5.5
-
- Module:
- -> https://github.com/sidex15/ksu_module_susfs
- Non-Official Managers:
- -> https://github.com/rifsxd/KernelSU-Next
-
- Features:
- [+] KernelSU-Next
- [+] SUSFS v1.5.5
- [+] Wireguard Support
- [+] Maphide LineageOS Detections
- [+] Futile Maphide for jit-zygote-cache Detections
- [+] Magic Mount Support
- steps:
- # Checkout the code
- - name: Checkout code
- uses: actions/checkout@v3
- - name: Determine the branch for KernelSU-Next
- run: |
- # Determine the branch based on user input
- if [[ "${{ inputs.kernelsu_branch }}" == "Stable" ]]; then
- BRANCH="Stable"
- elif [[ "${{ inputs.kernelsu_branch }}" == "Dev" ]]; then
- BRANCH="next"
- elif [[ "${{ inputs.kernelsu_branch }}" == "Other" && -n "${{ inputs.kernelsu_branch_other }}" ]]; then
- BRANCH="${{ inputs.kernelsu_branch_other }}"
- else
- echo "Error: Custom branch not provided for 'Other'" >&2
- exit 1
- fi
- # Store the selected branch in GITHUB_ENV
- echo "KSU_BRANCH=$BRANCH" >> $GITHUB_ENV
- - name: Get commit hash or tag and generate URL for KernelSU-Next
- run: |
- REPO_URL="https://github.com/rifsxd/KernelSU-Next.git"
- BRANCH="${{ env.KSU_BRANCH }}"
-
- if [[ "$BRANCH" == "Stable" ]]; then
- # Fetch the latest tag
- TAG=$(git ls-remote --tags --sort=-v:refname $REPO_URL | grep -o 'refs/tags/.*' | cut -d'/' -f3 | head -n1)
- if [[ -z "$TAG" ]]; then
- echo "Error: Could not fetch latest tag for KernelSU-Next" >&2
- exit 1
- fi
- KSU_REF=$TAG
- KSU_URL="https://github.com/rifsxd/KernelSU-Next/releases/tag/$TAG"
- elif [[ "$BRANCH" == "next" ]]; then
- # Fetch the latest commit from "next" branch
- COMMIT_HASH=$(git ls-remote $REPO_URL refs/heads/$BRANCH | awk '{ print $1 }')
- if [[ -z "$COMMIT_HASH" ]]; then
- echo "Error: Could not fetch latest commit for KernelSU-Next Dev" >&2
- exit 1
- fi
- KSU_REF=$COMMIT_HASH
- KSU_URL="https://github.com/rifsxd/KernelSU-Next/commit/$COMMIT_HASH"
- else
- # Fetch the specific tag for the custom branch
- TAG=$BRANCH
- if git ls-remote --tags $REPO_URL | grep -q "refs/tags/$TAG"; then
- KSU_REF=$TAG
- KSU_URL="https://github.com/rifsxd/KernelSU-Next/releases/tag/$TAG"
- else
- echo "Error: Specified tag '$TAG' not found in KernelSU-Next" >&2
- exit 1
- fi
- fi
- # Echo the values to GitHub environment for later use
- echo "KSU_REF=$KSU_REF" >> $GITHUB_ENV
- echo "KSU_URL=$KSU_URL" >> $GITHUB_ENV
- echo "KernelSU-Next Reference: $KSU_REF"
- echo "KernelSU-Next URL: $KSU_URL"
- - name: Get commit hashes and generate commit URLs
- run: |
- GITLAB_OWNER="simonpunk"
- GITLAB_REPO="susfs4ksu"
- declare -A BRANCH_MAP=(
- ["gki_android12_5_10"]="gki-android12-5.10"
- ["gki_android13_5_10"]="gki-android13-5.10"
- ["gki_android13_5_15"]="gki-android13-5.15"
- ["gki_android14_5_15"]="gki-android14-5.15"
- ["gki_android14_6_1"]="gki-android14-6.1"
- )
- for var_name in "${!BRANCH_MAP[@]}"; do
- branch_name="${BRANCH_MAP[$var_name]}"
- COMMIT_HASH=$(git ls-remote https://gitlab.com/$GITLAB_OWNER/$GITLAB_REPO.git refs/heads/$branch_name | awk '{ print $1 }')
- if [[ -n "$COMMIT_HASH" ]]; then
- COMMIT_URL="https://gitlab.com/$GITLAB_OWNER/$GITLAB_REPO/-/commit/$COMMIT_HASH"
- echo "$branch_name Commit: $COMMIT_HASH"
- echo "$branch_name Commit URL: $COMMIT_URL"
- # Store commit hash and commit URL in GitHub environment
- echo "COMMIT_HASH_${var_name}=$COMMIT_HASH" >> "$GITHUB_ENV"
- echo "COMMIT_URL_${var_name}=$COMMIT_URL" >> "$GITHUB_ENV"
- fi
- done
-
- - name: Append Commit Hashes & Links to `RELEASE_NOTES` & Append KernelSU-Next Reference to `RELEASE_NOTES`
- run: |
- echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
- echo "$RELEASE_NOTES" >> $GITHUB_ENV
- echo "" >> $GITHUB_ENV
- echo "LTO TYPE: ${{ inputs.lto_type }}" >> $GITHUB_ENV
- echo "" >> $GITHUB_ENV
- echo "Commit Hashes & Links:" >> $GITHUB_ENV
- echo "KernelSU-Next: [$KSU_REF]($KSU_URL)" >> $GITHUB_ENV
- echo "SUSFS4KSU:" >> $GITHUB_ENV
- echo "gki-android12-5.10: [$COMMIT_HASH_gki_android12_5_10]($COMMIT_URL_gki_android12_5_10)" >> $GITHUB_ENV
- echo "gki-android13-5.10: [$COMMIT_HASH_gki_android13_5_10]($COMMIT_URL_gki_android13_5_10)" >> $GITHUB_ENV
- echo "gki-android13-5.15: [$COMMIT_HASH_gki_android13_5_15]($COMMIT_URL_gki_android13_5_15)" >> $GITHUB_ENV
- echo "gki-android14-5.15: [$COMMIT_HASH_gki_android14_5_15]($COMMIT_URL_gki_android14_5_15)" >> $GITHUB_ENV
- echo "gki-android14-6.1: [$COMMIT_HASH_gki_android14_6_1]($COMMIT_URL_gki_android14_6_1)" >> $GITHUB_ENV
- echo "EOF" >> $GITHUB_ENV
-
- # Get the Latest Tag from GitHub
- - name: Generate and Create New Tag
- run: |
- # Fetch the latest tag from GitHub (this is the latest tag based on the GitHub API)
- LATEST_TAG=$(gh api repos/$REPO_OWNER/$REPO_NAME/tags --jq '.[0].name')
- if [ -z "$LATEST_TAG" ]; then
- LATEST_TAG="v1.5.4-0"
- fi
-
- NEW_TAG=$(echo "$LATEST_TAG" | awk -F- '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-%d", $1, suffix}')
-
- # Output the new tag to be used
- echo "New tag: $NEW_TAG"
-
- # Set the new tag as an environment variable to be used in later steps
- echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
- # Create the tag in the repository
- git tag $NEW_TAG
- git push origin $NEW_TAG
-
- # Download Artifacts for A12 (Only if A12 Build is successful or input is true or empty)
- - name: Download Artifacts
- uses: actions/download-artifact@v4
- with:
- path: ./downloaded-artifacts
- # Create GitHub Release and upload files if make_release is true
- - name: Create GitHub Release
- uses: actions/create-release@v1
- with:
- tag_name: ${{ env.NEW_TAG }} # Use the generated tag for the release
- prerelease: true # Mark the release as a pre-release
- release_name: ${{ env.RELEASE_NAME }} # Pass the RELEASE_NAME to the action
- body: ${{ env.RELEASE_NOTES }} # Pass the RELEASE_NOTES to the action
- - name: Upload Release Assets Dynamically
- run: |
- # Loop through all files in the downloaded-artifacts directory
- for file in ./downloaded-artifacts/kernel-*/*; do
- # Skip directories
- if [ -d "$file" ]; then
- continue
- fi
- # Upload the file to the GitHub release
- echo "Uploading $file..."
- gh release upload ${{ env.NEW_TAG }} "$file"
- done
- # Display Files Uploaded
- - name: Display Files Uploaded
- run: |
- echo "GitHub release created with the following files:"
- ls ./downloaded-artifacts/**/*
|