Skip to content

Commit

Permalink
CI: sanitize the branch's name for the output zip
Browse files Browse the repository at this point in the history
* needed to post builds that have "/" in their branch's name

Signed-off-by: David112x <[email protected]>
  • Loading branch information
David112x committed May 17, 2024
1 parent 713bec4 commit 2445c57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export BUILD_ID=$((GITHUB_RUN_NUMBER + 199))
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export SYSMEM="$(($(vmstat -s | grep -i 'total memory' | sed 's/ *//' | sed 's/total//g;s/memory//g;s/K//g;s/ / /g') / 1000))"
export GITBRNCH="$(git rev-parse --abbrev-ref HEAD)"
export BLDBRNCH="$(echo $GITBRNCH | sed 's/\//_/g')"
if [ "$(cat /sys/devices/system/cpu/smt/active)" = "1" ]; then
export THREADS=$(($(nproc --all) * 2))
else
Expand Down Expand Up @@ -109,7 +110,7 @@ cd AnyKernel3
zip -r9 UPDATE-AnyKernel3.zip * -x README.md LICENSE UPDATE-AnyKernel3.zip zipsigner.jar
cp UPDATE-AnyKernel3.zip package.zip
curl -sLo zipsigner-3.0.jar https://github.com/Magisk-Modules-Repo/zipsigner/raw/master/bin/zipsigner-3.0-dexed.jar
java -jar zipsigner-3.0.jar UPDATE-AnyKernel3.zip Sunscape-$GITBRNCH-$BUILD_ID.zip
java -jar zipsigner-3.0.jar UPDATE-AnyKernel3.zip Sunscape-$BLDBRNCH-$BUILD_ID.zip
BUILD_END=$(date +"%s")
DIFF=$((BUILD_END - BUILD_START))
tg_post_build "Sunscape-$GITBRNCH-$BUILD_ID.zip" "Build took : $((DIFF / 60)) minute(s) and $((DIFF % 60)) second(s)"
tg_post_build "Sunscape-$BLDBRNCH-$BUILD_ID.zip" "Build took : $((DIFF / 60)) minute(s) and $((DIFF % 60)) second(s)"
5 changes: 3 additions & 2 deletions cirrus_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export BUILD_ID=$CIRRUS_BUILD_ID
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export SYSMEM="$(($(vmstat -s | grep -i 'total memory' | sed 's/ *//' | sed 's/total//g;s/memory//g;s/K//g;s/ / /g') / 1000))"
export GITBRNCH="$(git rev-parse --abbrev-ref HEAD)"
export BLDBRNCH="$(echo $GITBRNCH | sed 's/\//_/g')"
if [ "$(cat /sys/devices/system/cpu/smt/active)" = "1" ]; then
export THREADS=$(($(nproc --all) * 2))
else
Expand Down Expand Up @@ -112,7 +113,7 @@ cd AnyKernel3
zip -r9 UPDATE-AnyKernel3.zip * -x README.md LICENSE UPDATE-AnyKernel3.zip zipsigner.jar
cp UPDATE-AnyKernel3.zip package.zip
curl -sLo zipsigner-3.0.jar https://github.com/Magisk-Modules-Repo/zipsigner/raw/master/bin/zipsigner-3.0-dexed.jar
java -jar zipsigner-3.0.jar UPDATE-AnyKernel3.zip Sunscape-$GITBRNCH-$BUILD_ID.zip
java -jar zipsigner-3.0.jar UPDATE-AnyKernel3.zip Sunscape-$BLDBRNCH-$BUILD_ID.zip
BUILD_END=$(date +"%s")
DIFF=$((BUILD_END - BUILD_START))
tg_post_build "Sunscape-$GITBRNCH-$BUILD_ID.zip" "Build took : $((DIFF / 60)) minute(s) and $((DIFF % 60)) second(s)"
tg_post_build "Sunscape-$BLDBRNCH-$BUILD_ID.zip" "Build took : $((DIFF / 60)) minute(s) and $((DIFF % 60)) second(s)"

0 comments on commit 2445c57

Please sign in to comment.