From 2f78399ee770da399ba2f61e792c0af7f3af5c1f Mon Sep 17 00:00:00 2001 From: Joshua Riek Date: Mon, 7 Oct 2024 16:29:47 -0400 Subject: [PATCH] UBUNTU: Add github actions workflow --- .github/workflows/build.yaml | 52 +++++++++++++++++++++++++++++++ .github/workflows/compile.yaml | 56 ---------------------------------- 2 files changed, 52 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/build.yaml delete mode 100644 .github/workflows/compile.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000000000..04a372bb2f66f --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,52 @@ +on: + workflow_dispatch: + push: + pull_request: + types: [opened, reopened, edited, synchronize] + branches: + - jammy + - noble + - oracular +name: Build kernel + +jobs: + build: + runs-on: ubuntu-latest + name: Build + steps: + - name: Install dependencies + shell: bash + run: | + sudo apt-get update && apt-get purge needrestart -y && sudo apt-get upgrade -y + sudo apt-get install -y build-essential gcc-aarch64-linux-gnu bison \ + u-boot-tools binfmt-support flex libssl-dev bc rsync kmod cpio xz-utils fakeroot \ + udev dosfstools uuid-runtime device-tree-compiler python3 python-is-python3 \ + bc debhelper swig libfdt-dev libpython3-dev dctrl-tools + + - name: Checkout Kernel repo + uses: actions/checkout@v4 + + - name: Setup Environment Variables + shell: bash + run: | + { + echo "$(dpkg-architecture -aarm64)" + echo "CROSS_COMPILE=aarch64-linux-gnu-" + echo "CC=aarch64-linux-gnu-gcc" + echo "LANG=C" + } >> $GITHUB_ENV + + - name: Build Kernel at ${{ github.sha }} + shell: bash + run: | + echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV + echo "$CROSS_COMPILE" + echo "$CC" + fakeroot debian/rules clean binary-headers binary-rockchip do_mainline_build=true + + - name: Upload Artifact + uses: actions/upload-artifact@v4.3.3 + with: + name: linux-rockchip + path: ${{ env.artifacts_path }}/*.deb + if-no-files-found: error diff --git a/.github/workflows/compile.yaml b/.github/workflows/compile.yaml deleted file mode 100644 index 244258ab918fa..0000000000000 --- a/.github/workflows/compile.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: Build Kernels at PR - -on: - workflow_dispatch: - pull_request: - types: [opened, reopened, edited, synchronize] - -jobs: - - Build: - name: Compile kernel - runs-on: rockchip - if: ${{ github.repository_owner == 'armbian' }} - env: - OCI_TARGET_BASE: "ghcr.io/${{ github.repository }}/" # This is picked up by the Docker launcher automatically - steps: - - # Login to ghcr.io, for later uploading rootfs to ghcr.io - - name: Docker Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} # GitHub username or org - password: ${{ secrets.GITHUB_TOKEN }} # GitHub actions builtin token. repo has to have pkg access. - - - name: Checkout build repo - uses: actions/checkout@v3 - with: - repository: armbian/build - ref: main - fetch-depth: 1 - clean: false - - - name: Build Kernel at ${{ github.event.pull_request.head.sha }} - id: kernel - run: | - - rm -rf output/debs/* - mkdir -p userpatches/extensions/ - cat <<- EOF > userpatches/extensions/pull-request.sh - function post_family_config__force_commit_for_rk3588() { - KERNELBRANCH="commit:${{ github.event.pull_request.head.sha }}" - } - EOF - bash ./compile.sh kernel \ - SHARE_LOG=yes \ - BOARD=orangepi5 \ - BRANCH=vendor \ - ENABLE_EXTENSIONS="pull-request" - - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: linux-rockchip-vendor - path: output/debs/*.deb - retention-days: 5