Skip to content

CI Build

CI Build #669

Workflow file for this run

name: CI Build
on:
workflow_dispatch:
inputs:
Build_Kernel:
required: true
type: choice
default: KSU & NonKSU
options:
- KSU
- NonKSU
- KSU & NonKSU
KSU_Manager_Non_GKI:
required: true
type: boolean
default: false
Kernel_Git:
required: true
type: string
default: https://github.com/silvzr/bootlegger_kernel_archive.git
Kernel_Branch:
required: true
type: string
default: pos14
AnyKernel3_Git:
required: true
type: string
default: https://github.com/silvzr/AnyKernel3.git
Device_Code:
required: true
type: string
default: davinci
Device_Defconfig:
required: true
type: string
default: davinci_defconfig
Common_Defconfig:
required: false
type: string
os:
required: true
type: string
default: ubuntu-latest
jobs:
build-ksu-manager:
if: ${{ inputs.KSU_Manager_Non_GKI == true && (inputs.Build_Kernel == 'KSU' || inputs.Build_Kernel == 'KSU & NonKSU') }}
uses: ./.github/workflows/build-ksu-manager.yml
secrets: inherit
build-ksu:
needs: [build-ksu-manager]
if: ${{ (inputs.Build_Kernel == 'KSU' || inputs.Build_Kernel == 'KSU & NonKSU') && !failure() && !cancelled() }}
uses: ./.github/workflows/build-kernel.yml
with:
include_ksu: "KSU"
include_ksu_manager: ${{ inputs.KSU_Manager_Non_GKI }}
kernel_git: ${{ inputs.Kernel_Git }}
kernel_branch: ${{ inputs.Kernel_Branch }}
anykernel3_git: ${{ inputs.AnyKernel3_Git }}
device_code: ${{ inputs.Device_Code }}
device_defconfig: ${{ inputs.Device_Defconfig }}
common_defconfig: ${{ inputs.Common_Defconfig }}
os: ${{ inputs.os }}
build-nonksu:
if: ${{ inputs.Build_Kernel == 'NonKSU' || inputs.Build_Kernel == 'KSU & NonKSU' }}
uses: ./.github/workflows/build-kernel.yml
with:
include_ksu: "NonKSU"
include_ksu_manager: "false"
kernel_git: ${{ inputs.Kernel_Git }}
kernel_branch: ${{ inputs.Kernel_Branch }}
anykernel3_git: ${{ inputs.AnyKernel3_Git }}
device_code: ${{ inputs.Device_Code }}
device_defconfig: ${{ inputs.Device_Defconfig }}
common_defconfig: ${{ inputs.Common_Defconfig }}
os: ${{ inputs.os }}
release:
needs: [build-ksu-manager, build-ksu, build-nonksu]
if: |
always() &&
!failure() &&
!cancelled()
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Tag
id: tag
run: |
latest_tag=$(curl -s https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | grep "tag_name" | cut -d '"' -f 4)
if [[ -z "$latest_tag" ]]; then latest_tag='v0'; fi
echo "Latest Tag: $latest_tag"
echo "tag=v$((${latest_tag:1} + 1))" >> $GITHUB_ENV
- name: Download artifacts
id: artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: false
path: out/download/.
- name: Prepare Release
id: prepare
run: |
cd $GITHUB_WORKSPACE
mkdir -p out/artifacts
if [[ $(ls out/download | grep "\-KSU") ]]; then
cp out/download/*-KSU/bodyFile.md out/bodyFile.md
echo "name=$(cat out/download/*-KSU/name.txt)" >> $GITHUB_ENV
else
cp out/download/*-NonKSU/bodyFile.md out/bodyFile.md
echo "name=$(cat out/download/*-NonKSU/name.txt)" >> $GITHUB_ENV
fi
if [[ $(ls out/download | grep "manager") ]]; then
cp out/download/manager/*.apk out/artifacts/Manager.apk
fi
cp out/download/*KSU/*.zip out/artifacts/
- name: Release
id: release
uses: ncipollo/release-action@v1
with:
name: "${{ env.name }}-${{ env.tag }}"
tag: "${{ env.tag }}"
allowUpdates: false
bodyFile: "${{ github.workspace }}/out/bodyFile.md"
artifacts: "${{ github.workspace }}/out/artifacts/*"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup
id: cleanup
run: rm -r $GITHUB_WORKSPACE/out/*