Skip to content

Commit e61acb2

Browse files
committed
Use git to get latest xanmod kernel
1 parent 3290c3d commit e61acb2

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

.github/workflows/kernel-update.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -133,24 +133,10 @@ jobs:
133133
run: |
134134
#brew install gnu-sed
135135
latestrelease=$(grep ^KERNEL_VERSION build.sh | head -n1| cut -d = -f2)
136-
if [[ $(curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -sL https://xanmod.org/ | grep -A2 "Rolling Release" | grep xanmod | cut -d '=' -f 9 | cut -d '-' -f 1) ]]
137-
then
138-
echo "Rolling Release"
139-
latestupstream=$(curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -sL https://xanmod.org/ | grep -A2 "Rolling Release" | grep xanmod | cut -d '=' -f 9 | cut -d '-' -f 1)
140-
else
141-
echo "Stable Mainline"
142-
latestupstream=$(curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -sL https://xanmod.org/ | grep -A2 "Stable Mainline" | grep xanmod | cut -d '=' -f 9 | cut -d '-' -f 1)
143-
fi
136+
latestupstream=$(git ls-remote --tags --refs https://gitlab.com/xanmod/linux.git | awk -F/ '{print $3}' | sort -V | grep -v -- '-rt' | tail -n1 | cut -d '-' -f 1)
144137
145138
latestpkgrel=$(grep "PKGREL=\d*" build.sh | cut -d = -f2)
146-
if [[ $(curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -sL https://xanmod.org/ | grep -A2 "Rolling Release" | grep xanmod | cut -d '=' -f 9 | cut -d '-' -f 2) ]]
147-
then
148-
echo "Rolling Release"
149-
latestpkgupstream=$(curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -sL https://xanmod.org/ | grep -A2 "Rolling Release" | grep xanmod | cut -d '=' -f 9 | cut -d '-' -f 2)
150-
else
151-
echo "Stable Mainline"
152-
latestpkgupstream=$(curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -sL https://xanmod.org/ | grep -A2 "Stable Mainline" | grep xanmod | cut -d '=' -f 9 | cut -d '-' -f 2)
153-
fi
139+
latestpkgupstream=$(git ls-remote --tags --refs https://gitlab.com/xanmod/linux.git | awk -F/ '{print $3}' | sort -V | grep -v -- '-rt' | tail -n1 | cut -d '-' -f 2)
154140
155141
echo "latestrelease: ${latestrelease}"
156142
echo "latestupstream: ${latestupstream}"
@@ -198,11 +184,12 @@ jobs:
198184
id: publish
199185
run: |
200186
#brew install gnu-sed
187+
LTS_VER=6.12
201188
latestrelease=$(grep ^KERNEL_VERSION build.sh | head -n1| cut -d = -f2)
202-
latestupstream=$(curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -sL https://xanmod.org/ | grep -A2 "Long Term Support" | grep xanmod | cut -d '=' -f 9 | cut -d '-' -f 1)
189+
latestupstream=$(git ls-remote --tags --refs https://gitlab.com/xanmod/linux.git | awk -F/ '{print $3}' | grep "^${LTS_VER}" | sort -V | grep -v -- '-rt' | tail -n1 | cut -d '-' -f 1)
203190
204191
latestpkgrel=$(grep "PKGREL=\d*" build.sh | cut -d = -f2)
205-
latestpkgupstream=$(curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -sL https://xanmod.org/ | grep -A2 "Long Term Support" | grep xanmod | cut -d '=' -f 9 | cut -d '-' -f 2)
192+
latestpkgupstream=$(git ls-remote --tags --refs https://gitlab.com/xanmod/linux.git | awk -F/ '{print $3}' | grep "^${LTS_VER}" | sort -V | grep -v -- '-rt' | tail -n1 | cut -d '-' -f 2)
206193
207194
echo "latestrelease: ${latestrelease}"
208195
echo "latestupstream: ${latestupstream}"

0 commit comments

Comments
 (0)