Skip to content

Commit

Permalink
Cleaned and squashed commits
Browse files Browse the repository at this point in the history
Cleaned for lineage 21.0 releases
  • Loading branch information
0xsharkboy committed Jun 30, 2024
0 parents commit b1ee5ca
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Highlights & Device Specific Changes:
Build type: Unofficial
Device: Redmi Note 7 (lavender)
Device maintainer: 0xsharkboy

13 changes: 13 additions & 0 deletions lavender.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"response": [
{
"datetime": "",
"filename": "",
"id": "",
"romtype": "",
"size": "",
"url": "",
"version": ""
}
]
}
42 changes: 42 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

if [ -z "$1" ] ; then
echo "Usage: $0 <ota zip>"
exit 1
fi

ROM="$1"

METADATA=$(unzip -p "$ROM" META-INF/com/android/metadata)
SDK_LEVEL=$(echo "$METADATA" | grep post-sdk-level | cut -f2 -d '=')
TIMESTAMP=$(echo "$METADATA" | grep post-timestamp | cut -f2 -d '=')

FILENAME=$(basename $ROM)
DEVICE=$(echo $FILENAME | cut -f5 -d '-' | cut -f1 -d".")
ROMTYPE=$(echo $FILENAME | cut -f4 -d '-')
DATE=$(echo $FILENAME | cut -f3 -d '-')
ID=$(echo ${TIMESTAMP}${DEVICE}${SDK_LEVEL} | sha256sum | cut -f 1 -d ' ')
SIZE=$(du -b $ROM | cut -f1 -d ' ')
TYPE=$(echo $FILENAME | cut -f4 -d '-')
VERSION=$(echo $FILENAME | cut -f2 -d '-')
RELASE_TAG=${DEVICE}_lineage-${VERSION}_${TIMESTAMP}

URL="https://github.com/0xsharkboy/Lineage_OTA/releases/download/${RELASE_TAG}/${FILENAME}"

response=$(jq -n --arg datetime $TIMESTAMP \
--arg filename $FILENAME \
--arg id $ID \
--arg romtype $ROMTYPE \
--arg size $SIZE \
--arg url $URL \
--arg version $VERSION \
'$ARGS.named'
)
wrapped_response=$(jq -n --argjson response "[$response]" '$ARGS.named')

echo "$wrapped_response" > $DEVICE.json
git add $DEVICE.json
git commit -m "Update autogenerated json for $DEVICE $VERSION ${DATE}/${TIMESTAMP}"
git push

gh release create $RELASE_TAG $ROM --notes "Automated release for $DEVICE $VERSION ${DATE}/${TIMESTAMP}"

0 comments on commit b1ee5ca

Please sign in to comment.