From 7133800bea77904c545b2d937493684fd028c286 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Wed, 10 Jan 2024 00:43:08 +0100 Subject: [PATCH] testing2 --- .github/workflows/build_for_x86.yml | 45 +++++++++++++++++++++++++++++ before-install.sh | 2 ++ build_chroot.sh | 35 ++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 .github/workflows/build_for_x86.yml create mode 100644 before-install.sh create mode 100644 build_chroot.sh diff --git a/.github/workflows/build_for_x86.yml b/.github/workflows/build_for_x86.yml new file mode 100644 index 0000000..20f73ae --- /dev/null +++ b/.github/workflows/build_for_x86.yml @@ -0,0 +1,45 @@ +name: build on x86 lunar + +on: [push] + + +jobs: + build: + #runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 + env: + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + steps: + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + root-reserve-mb: 512 + swap-size-mb: 1024 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + overprovision-lvm: 'true' + - name: test + run: | + echo "DT=$(date +'%Y-%m-%d_%H%M')" >> $GITHUB_ENV + echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV + + - name: Checkout repository and submodules + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Building OpenHD in CHROOT + run: | + git clone https://github.com/OpenHD/ChrootCompilationTest /opt/ChrootCompilationTest + mkdir -p /opt/ChrootCompilationTest/additionalFiles + git clone https://github.com/OpenHD/rtl8812au -b ${{ github.ref_name }} /opt/ChrootCompilationTest/additionalFiles/ --recursive + echo $CLOUDSMITH_API_KEY > /opt/ChrootCompilationTest/additionalFiles/cloudsmith_api_key.txt + echo "AMD64" > /opt/ChrootCompilationTest/additionalFiles/arch.txt + echo "ubuntu" > /opt/ChrootCompilationTest/additionalFiles/distro.txt + echo "lunar" > /opt/ChrootCompilationTest/additionalFiles/flavor.txt + echo "${{ github.ref_name }}" > /opt/ChrootCompilationTest/additionalFiles/repo.txt + + cd /opt/ChrootCompilationTest/ + sudo apt update + sudo bash install_dep.sh + sudo bash ./build.sh x86-lunar $API_KEY ubuntu lunar diff --git a/before-install.sh b/before-install.sh new file mode 100644 index 0000000..822ea02 --- /dev/null +++ b/before-install.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo rm -Rf /lib/modules/6.3.13-060313-generic/kernel/drivers/net/wireless/88XXau_wfb.ko \ No newline at end of file diff --git a/build_chroot.sh b/build_chroot.sh new file mode 100644 index 0000000..1458e83 --- /dev/null +++ b/build_chroot.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# This file is the install instruction for the CHROOT build +# We're using cloudsmith-cli to upload the file in CHROOT + +sudo apt install -y python3-pip ruby ruby-dev rubygems build-essential +gem install fpm +sudo pip3 install --upgrade cloudsmith-cli --break-system-packages +ls -a +API_KEY=$(cat cloudsmith_api_key.txt) +DISTRO=$(cat distro.txt) +FLAVOR=$(cat flavor.txt) +REPO=$(cat repo.txt) +CUSTOM=$(cat custom.txt) +ARCH=$(cat arch.txt) + +echo ${DISTRO} +echo ${FLAVOR} +echo ${CUSTOM} +echo ${ARCH} + + +sudo apt update +sudo apt install -y build-essential flex bc bison dkms +make KSRC=/usr/src/linux-headers-6.3.13-060313-generic O="" modules +mkdir -p package/lib/modules/6.3.13-060313-generic/kernel/drivers/net/wireless/ +cp *.ko package/lib/modules/6.3.13-060313-generic/kernel/drivers/net/wireless/ +ls -a +fpm -a amd64 -s dir -t deb -n rtl88x2bu-x86 -v 2.5-evo-$(date '+%m%d%H%M') -C package -p rtl88x2bu-x86.deb --before-install before-install.sh + +echo "copied deb file" +echo "push to cloudsmith" +git describe --exact-match HEAD >/dev/null 2>&1 +echo "Pushing the package to OpenHD 2.5 repository" +ls -a +cloudsmith push deb --api-key "$API_KEY" openhd/release/ubuntu/lunar rtl88x2bu-x86.deb || exit 1