Skip to content

Commit

Permalink
CI: Add localversion to filename (#111)
Browse files Browse the repository at this point in the history
* feat: Add localversion to filename

* fix localversion directory

* disable feature by default
  • Loading branch information
mohamedamrnady authored Dec 12, 2023
1 parent c32ba06 commit aaf8a67
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build-kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
echo "KERNEL_CONFIG=$(cat $CONFIG_ENV | grep -w "KERNEL_CONFIG" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "KERNEL_IMAGE_NAME=$(cat $CONFIG_ENV | grep -w "KERNEL_IMAGE_NAME" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "ARCH=$(cat $CONFIG_ENV | grep -w "ARCH" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "ADD_LOCALVERSION_TO_FILENAME=$(cat $CONFIG_ENV | grep -w "ADD_LOCALVERSION_TO_FILENAME" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "EXTRA_CMDS=$(cat $CONFIG_ENV | grep -w "EXTRA_CMDS" | head -n 1 | cut -d ":" -f 2)" >> $GITHUB_ENV
echo "USE_CUSTOM_CLANG=$(cat $CONFIG_ENV | grep -w "USE_CUSTOM_CLANG" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
echo "CUSTOM_CLANG_SOURCE=$(cat $CONFIG_ENV | grep -w "CUSTOM_CLANG_SOURCE" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV
Expand Down Expand Up @@ -159,6 +160,11 @@ jobs:
run: |
cd $GITHUB_WORKSPACE/kernel_workspace
git clone ${{ env.KERNEL_SOURCE }} -b ${{ env.KERNEL_SOURCE_BRANCH }} android-kernel --depth=1
if [[ ${{ env.ADD_LOCALVERSION_TO_FILENAME }} == 'true' ]]; then
echo "LOCALVERSION=$(cat android-kernel/localversion)" >> $GITHUB_ENV
else
echo "LOCALVERSION=" >> $GITHUB_ENV
fi
- name: Download source boot image
if: env.BUILD_BOOT_IMG == 'true'
Expand Down Expand Up @@ -203,7 +209,7 @@ jobs:
if: env.ENABLE_CCACHE == 'true'
uses: hendrikmuhs/ccache-action@v1.2
with:
key: build-kernel-${{ env.DEVICE }}${{ env.UPLOADNAME }}
key: build-kernel-${{ env.DEVICE }}${{ env.LOCALVERSION }}${{ env.UPLOADNAME }}
max-size: 2G

- name: Build kernel
Expand Down Expand Up @@ -273,14 +279,14 @@ jobs:
if: env.CHECK_FILE_IS_OK == 'true'
uses: actions/upload-artifact@v3
with:
name: ${{ env.KERNEL_IMAGE_NAME }}${{ env.UPLOADNAME }}-${{ env.DEVICE }}-${{ env.BUILD_TIME }}
name: ${{ env.KERNEL_IMAGE_NAME }}${{ env.LOCALVERSION }}${{ env.UPLOADNAME }}-${{ env.DEVICE }}-${{ env.BUILD_TIME }}
path: kernel_workspace/android-kernel/out/arch/${{ env.ARCH }}/boot/${{ env.KERNEL_IMAGE_NAME }}

- name: Upload AnyKernel3
if: env.CHECK_FILE_IS_OK == 'true'
uses: actions/upload-artifact@v3
with:
name: AnyKernel3${{ env.UPLOADNAME }}-${{ env.DEVICE }}-${{ env.BUILD_TIME }}
name: AnyKernel3${{ env.LOCALVERSION }}${{ env.UPLOADNAME }}-${{ env.DEVICE }}-${{ env.BUILD_TIME }}
path: kernel_workspace/AnyKernel3/*

- name: Upload DTBO image
Expand All @@ -294,5 +300,5 @@ jobs:
if: env.MAKE_BOOT_IMAGE_IS_OK == 'true'
uses: actions/upload-artifact@v3
with:
name: boot${{ env.UPLOADNAME }}-${{ env.DEVICE }}-${{ env.BUILD_TIME }}
name: boot${{ env.LOCALVERSION }}${{ env.UPLOADNAME }}-${{ env.DEVICE }}-${{ env.BUILD_TIME }}
path: kernel_workspace/boot.img
1 change: 1 addition & 0 deletions config.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ KERNEL_SOURCE_BRANCH=twrp-12
KERNEL_CONFIG=vendor/wayne_defconfig
KERNEL_IMAGE_NAME=Image.gz-dtb
ARCH=arm64
ADD_LOCALVERSION_TO_FILENAME=false
EXTRA_CMDS:LD=ld.lld

# Clang
Expand Down

0 comments on commit aaf8a67

Please sign in to comment.