diff --git a/.github/workflows/build_for_x86.yml b/.github/workflows/build_for_x86.yml new file mode 100644 index 0000000..6c03d94 --- /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/rtl88x2bu -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/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 87d8fe5..4937fb4 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -16,14 +16,9 @@ jobs: with: submodules: recursive - - name: install dependencies - run: | - sudo apt install -y ruby-dev - sudo gem install fpm - - name: build on x86 run: | sudo apt update - sudo apt install -y build-essential tree + sudo apt install -y build-essential make ls \ No newline at end of file diff --git a/before-install.sh b/before-install.sh new file mode 100644 index 0000000..a9879ce --- /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/88X2bu.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