Skip to content

Build and Release Sultan Kernels #25

Build and Release Sultan Kernels

Build and Release Sultan Kernels #25

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: true
jobs:
build-kernel-a15-gs201:
uses: ./.github/workflows/gs201.yml
secrets: inherit
build-kernel-a15-zuma:
uses: ./.github/workflows/zuma.yml
secrets: inherit
build-kernel-a15-zumapro:
uses: ./.github/workflows/zumapro.yml
secrets: inherit
trigger-release:
runs-on: ubuntu-latest
needs:
- build-kernel-a15-gs201
- build-kernel-a15-zuma
- build-kernel-a15-zumapro
if: ${{ inputs.make_release }}
env:
REPO_OWNER: TheWildJames
REPO_NAME: Sultan_KernelSU_SUSFS
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: "*TEST BUILD* Sultan 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/KernelSU-Next/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
# 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.5-r0" # Default to v1.5.3-0 if no tag exists
fi
# Increment the suffix (e.g., v1.5.3-0 becomes v1.5.3-1)
NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_TAG: ${{ env.NEW_TAG }}
# Display Files Uploaded
- name: Display Files Uploaded
run: |
echo "GitHub release created with the following files:"
ls ./downloaded-artifacts/**/*