Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Commit e277354

Browse files
committed
initial attempt at repo
1 parent 7015871 commit e277354

2 files changed

Lines changed: 40 additions & 30 deletions

File tree

.github/workflows/build.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,35 @@ jobs:
2323
- uses: actions/checkout@v2
2424

2525
- name: Build script
26+
id: build
2627
run: |
2728
mkdir /tmp/artifacts
29+
VERSION=$(grep "KERNEL_VERSION=\d*\.\d*\.\d*" build.sh | cut -d = -f2)
30+
REL=$(grep "PKGREL=\d*" build.sh | cut -d = -f2)
31+
#REL=$( git tag |grep -F $VERSION|sort -r|head -n1|tr -d v)
32+
echo Building $VERSION-$REL
33+
echo "::set-output name=tag::${VERSION}-${REL}"
2834
sudo ./build.sh
35+
cd /tmp/artifacts
36+
ls -l
37+
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
38+
ls -l
2939
30-
- name: Upload package
40+
- name: Upload package artifact
3141
uses: actions/upload-artifact@v2
3242
with:
33-
name: mbp-16.1-linux-wifi
43+
name: linux-mbp-16X-wifi-${{ steps.build.outputs.tag }}
3444
path: /tmp/artifacts/*
45+
46+
- name: Release
47+
uses: softprops/action-gh-release@v1
48+
with:
49+
files: |
50+
/tmp/artifacts/Packages.gz
51+
/tmp/artifacts/sha256
52+
/tmp/artifacts/*.deb
53+
tag_name: v${{ steps.build.outputs.tag }}
54+
draft: true
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+

build.sh

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -eu -o pipefail
55
## Update docker image tag, because kernel build is using `uname -r` when defining package version variable
66
# KERNEL_VERSION=$(curl -s https://www.kernel.org | grep '<strong>' | head -3 | tail -1 | cut -d'>' -f3 | cut -d'<' -f1)
77
KERNEL_VERSION=5.12.8
8+
PKGREL=2
89
#KERNEL_REPOSITORY=git://kernel.ubuntu.com/virgin/linux-stable.git
910
KERNEL_REPOSITORY=https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
1011
REPO_PATH=$(pwd)
@@ -19,17 +20,18 @@ echo "CPU threads: $(nproc --all)"
1920
grep 'model name' /proc/cpuinfo | uniq
2021

2122
get_next_version () {
22-
curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep "linux-image-${KERNEL_VERSION}-${1}" > /dev/null
23-
OLD_BUILD_EXIST=$?
24-
if test $OLD_BUILD_EXIST -eq 0
25-
then
26-
LATEST_BUILD=$(curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep "linux-image-${KERNEL_VERSION}-${1}" |
27-
grep a | cut -d'>' -f2 | cut -d'<' -f1 |
28-
sort -r | head -n 1 | cut -d'-' -f6 | cut -d'_' -f1)
29-
else
30-
LATEST_BUILD=0
31-
fi
32-
echo "$((LATEST_BUILD+1))"
23+
echo $PKGREL
24+
#curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep "linux-image-${KERNEL_VERSION}-${1}" > /dev/null
25+
#OLD_BUILD_EXIST=$?
26+
#if test $OLD_BUILD_EXIST -eq 0
27+
#then
28+
# LATEST_BUILD=$(curl -s https://mbp-ubuntu-kernel.herokuapp.com/ -L | grep "linux-image-${KERNEL_VERSION}-${1}" |
29+
# grep a | cut -d'>' -f2 | cut -d'<' -f1 |
30+
# sort -r | head -n 1 | cut -d'-' -f6 | cut -d'_' -f1)
31+
#else
32+
# LATEST_BUILD=0
33+
#fi
34+
#echo "$((LATEST_BUILD+1))"
3335
}
3436

3537
### Clean up
@@ -68,7 +70,7 @@ echo >&2 "===]> Info: Applying patches... "
6870
while IFS= read -r file; do
6971
echo "==> Adding $file"
7072
patch -p1 <"$file"
71-
done < <(find "${WORKING_PATH}/patches" -type f -name "*.patch" | grep -vE '[2]00[0-9]' | sort)
73+
done < <(find "${WORKING_PATH}/patches" -type f -name "*.patch" | sort)
7274

7375
chmod a+x "${KERNEL_PATH}"/debian/rules
7476
chmod a+x "${KERNEL_PATH}"/debian/scripts/*
@@ -85,22 +87,7 @@ make olddefconfig
8587
echo "" >"${KERNEL_PATH}"/.scmversion
8688

8789
# Build Deb packages
88-
make -j "$(getconf _NPROCESSORS_ONLN)" deb-pkg LOCALVERSION=-mbp KDEB_PKGVERSION="$(make kernelversion)-$(get_next_version mbp-alt)"
89-
90-
# Create alternative Kernel
91-
echo >&2 "===]> Info: Create alternative kernel ... "
92-
make distclean
93-
make clean
94-
while IFS= read -r file; do
95-
echo "==> Adding $file"
96-
patch -p1 <"$file"
97-
done < <(find "${WORKING_PATH}/patches" -type f -name "*.patch" | grep -E '[2]00[0-9]' | sort)
98-
cp "${WORKING_PATH}/templates/default-config" "${KERNEL_PATH}/.config"
99-
make olddefconfig
100-
echo "" >"${KERNEL_PATH}"/.scmversion
101-
102-
# Build Deb packages
103-
make -j "$(getconf _NPROCESSORS_ONLN)" deb-pkg LOCALVERSION=-mbp-alt KDEB_PKGVERSION="$(make kernelversion)-$(get_next_version mbp)"
90+
make -j "$(getconf _NPROCESSORS_ONLN)" deb-pkg LOCALVERSION=-mbp-16X-wifi KDEB_PKGVERSION="$(make kernelversion)-$(get_next_version)"
10491

10592
#### Copy artifacts to shared volume
10693
echo >&2 "===]> Info: Copying debs and calculating SHA256 ... "

0 commit comments

Comments
 (0)