|
| 1 | +name: Build Kernel Release CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '*/release' |
| 7 | + |
| 8 | +env: |
| 9 | + GH_TOKEN: ${{ github.token }} |
| 10 | + TZ: ${{ secrets.TZ }} |
| 11 | + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} |
| 12 | + |
| 13 | +jobs: |
| 14 | + build-gki-clang: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Set up environment |
| 19 | + id: setup-env |
| 20 | + run: | |
| 21 | + sudo apt update -y |
| 22 | + sudo apt install -y repo elfutils libarchive-tools |
| 23 | +
|
| 24 | + - name: Initialize repo |
| 25 | + id: init-repo |
| 26 | + run: repo init -u https://github.com/DarknessKiller/android_kernel_manifest.git -b overdose-gki-5.10 --depth=1 |
| 27 | + |
| 28 | + - name: Use release repo |
| 29 | + id: use-release-repo |
| 30 | + run: | |
| 31 | + sed -i "s#revision=\"android12-5\.10-2023-04_r8/release\"#revision=\"$BRANCH_NAME\"#" .repo/manifests/default.xml |
| 32 | + cat .repo/manifests/default.xml |
| 33 | +
|
| 34 | + - name: Repo sync |
| 35 | + id: repo-sync |
| 36 | + run: repo sync --no-tags --no-clone-bundle -j$(nproc --all) |
| 37 | + |
| 38 | + - name: KernelSU sync |
| 39 | + id: kernelsu-sync |
| 40 | + run: | |
| 41 | + cd common |
| 42 | + git submodule update --init --recursive |
| 43 | +
|
| 44 | + - name: Fetch SlimLLVM |
| 45 | + id: fetch-slimllvm |
| 46 | + run: | |
| 47 | + rm -rf prebuilts-master/clang/host/linux-x86/clang-r416183b |
| 48 | + git clone https://gitlab.com/MRDarknessKiller/slimllvm.git -b 14 --depth=1 prebuilts-master/clang/host/linux-x86/clang-r416183b |
| 49 | +
|
| 50 | + - name: Configure build environment |
| 51 | + id: configure-build |
| 52 | + run: | |
| 53 | + echo "CURRENT_EPOCH=$(date +%s)" >> $GITHUB_OUTPUT |
| 54 | + sed -i 's/build-user/mrdarknessk/g; s/build-host/github-actions/g; s#TZ=UTC#TZ='"$TZ"'#g' build/_setup_env.sh |
| 55 | + sed -i 's/KBUILD_BUILD_TIMESTAMP="$(date -d @${SOURCE_DATE_EPOCH})"/KBUILD_BUILD_TIMESTAMP="$(date -d @${GITHUB_OUTPUT})"/g' build/_setup_env.sh |
| 56 | +
|
| 57 | + - name: Build kernel |
| 58 | + id: build-kernel |
| 59 | + run: | |
| 60 | + LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64.overdose build/build.sh |
| 61 | + |
| 62 | + - name: Create zip |
| 63 | + id: create-zip |
| 64 | + env: |
| 65 | + CURRENT_EPOCH: ${{ steps.configure-build.outputs.CURRENT_EPOCH }} |
| 66 | + run: | |
| 67 | + cp out/android12-5.10/dist/Image ak3/ |
| 68 | + cd ak3/ && zip -r9 "OverdoseGKI-5.10-$(date -d @$CURRENT_EPOCH '+%Y%m%d-%H%M').zip" * -x .git README.md ./*/placeholder |
| 69 | +
|
| 70 | + - name: Upload artifact |
| 71 | + id: upload-artifact |
| 72 | + uses: actions/upload-artifact@main |
| 73 | + with: |
| 74 | + name: release |
| 75 | + path: ak3/*.zip |
| 76 | + |
| 77 | + publish-release: |
| 78 | + needs: [build-gki-clang] |
| 79 | + runs-on: ubuntu-latest |
| 80 | + |
| 81 | + steps: |
| 82 | + - name: Checkout code |
| 83 | + id: checkout-code |
| 84 | + uses: actions/checkout@main |
| 85 | + |
| 86 | + - name: Download artifact |
| 87 | + id: download-artifact |
| 88 | + uses: actions/download-artifact@main |
| 89 | + with: |
| 90 | + name: release |
| 91 | + path: ${{ github.workspace }} |
| 92 | + |
| 93 | + - name: Release tag |
| 94 | + id: release-tag |
| 95 | + run: echo "TAG_NAME=$(date -u +%d%m%Y%I%M)" >> $GITHUB_ENV |
| 96 | + |
| 97 | + - name: Create release |
| 98 | + id: create-release |
| 99 | + run: gh release create ${{ env.TAG_NAME }} --generate-notes -p *.zip |
| 100 | + |
| 101 | + - name: Release check |
| 102 | + id: release-check |
| 103 | + run: gh release list -L 1 > list |
| 104 | + |
| 105 | + - name: Prepare release message |
| 106 | + id: prepare-release-message |
| 107 | + run: gh release view $(cat list | awk '{ print substr( $0, 1, length($0)-45 ) }') > release-text |
0 commit comments