CI Build #487
This file contains 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: CI Build | |
on: | |
workflow_dispatch: | |
inputs: | |
Build_Kernel: | |
required: true | |
type: choice | |
default: KSU & NonKSU | |
options: | |
- KSU | |
- NonKSU | |
- KSU & NonKSU | |
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: | |
if: ${{ inputs.Build_Kernel == 'KSU' || inputs.Build_Kernel == 'KSU & NonKSU' }} | |
uses: ./.github/workflows/build-kernel.yml | |
with: | |
include_ksu: "KSU" | |
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" | |
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, 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/* |