|
| 1 | +# This is a basic workflow to help you get started with Actions |
| 2 | + |
| 3 | +name: Build kernel |
| 4 | + |
| 5 | +# Controls when the workflow will run |
| 6 | +on: |
| 7 | + # Triggers the workflow on push or pull request events but only for the "master" branch |
| 8 | + push: |
| 9 | + tags: |
| 10 | + - '*' |
| 11 | + |
| 12 | + # Allows you to run this workflow manually from the Actions tab |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 16 | +jobs: |
| 17 | + # This workflow contains a single job called "build" |
| 18 | + build: |
| 19 | + name: Build kernel |
| 20 | + runs-on: ubuntu-latest |
| 21 | + container: quay.io/droidian/build-essential:current-amd64 |
| 22 | + |
| 23 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 24 | + steps: |
| 25 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 26 | + - uses: actions/checkout@v3 |
| 27 | + with: |
| 28 | + ref: melt-rebase |
| 29 | + |
| 30 | + - name: Update repositories |
| 31 | + run: | |
| 32 | + apt update |
| 33 | + apt install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison build-essential dpkg-dev findutils android-platform-prebuilts-python-linux-x86-2.7.5 bc rsync kmod cpio bison flex libssl-dev avbtool binutils-aarch64-linux-gnu clang-android-12.0-r416183b gcc-4.9-aarch64-linux-android g++-4.9-aarch64-linux-android libgcc-4.9-dev-aarch64-linux-android-cross lz4 -y |
| 34 | + wget https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+archive/refs/heads/main/clang-r536225.tar.gz -O /clang.tar.gz |
| 35 | + mkdir /clang |
| 36 | + tar -xvf /clang.tar.gz -C /clang |
| 37 | +
|
| 38 | + - name: Build kernel |
| 39 | + run: | |
| 40 | + export PATH=/clang/bin:/opt/android/prebuilts/python/2.7.5/bin:$PATH |
| 41 | + make ARCH=arm64 LLVM=1 LLVM_IAS=1 O=out marble_lxc_defconfig |
| 42 | + make ARCH=arm64 LLVM=1 LLVM_IAS=1 O=out -j$(nproc --all) |
| 43 | +
|
| 44 | + - name: Move kernel to out directory run: | |
| 45 | + mkdir /out cp ./out/arch/arm64/boot/Image /out/ ls /out - name: Upload artifacts |
| 46 | + uses: actions/upload-artifact@v3 |
| 47 | + with: name: linux-kernel path: /out/* if-no-files-found: error retention-days: 1 |
| 48 | + prepare: runs-on: ubuntu-20.04 name: Create GitHub release needs: build steps: |
| 49 | + - name: Delete old latest release |
| 50 | + uses: dev-drprasad/[email protected] |
| 51 | + with: |
| 52 | + delete_release: true # default: false |
| 53 | + tag_name: latest # tag name to delete |
| 54 | + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + - name: Tag latest |
| 56 | + |
| 57 | + with: |
| 58 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 59 | + tag: latest |
| 60 | + |
| 61 | + publish: |
| 62 | + runs-on: ubuntu-20.04 |
| 63 | + needs: prepare |
| 64 | + |
| 65 | + name: Publish linux-kernel |
| 66 | + |
| 67 | + steps: |
| 68 | + - name: Download artifacts |
| 69 | + uses: actions/download-artifact@v3 |
| 70 | + with: |
| 71 | + path: out |
| 72 | + |
| 73 | + - name: Create latest release |
| 74 | + uses: softprops/action-gh-release@v1 |
| 75 | + with: |
| 76 | + files: out/linux-kernel/* |
| 77 | + tag_name: latest |
| 78 | + draft: false |
| 79 | + prerelease: false |
0 commit comments