update deploy.sh

This commit is contained in:
Odweta
2024-12-31 17:34:24 +01:00
parent 8b98d92c2b
commit cc86373989
+18 -6
View File
@@ -11,21 +11,29 @@ cd ./mobile
ver=$(./gradlew printVersionName -q)
# add, commit, push
echo "\n[add, commit, push]\n"
echo
echo "[add, commit, push]"
echo
git add ..
git commit -m "made new release $ver"
git push
# build
echo "\n[building]\n"
echo
echo "[building]"
echo
./gradlew assembleRelease
# sign
echo "\n[signing]\n"
echo
echo "[signing]"
echo
~/Android/Sdk/build-tools/35.0.0/apksigner sign --alignment-preserved --ks ~/Documents/android-keystore.jks --ks-pass pass:$ks_pass app/build/outputs/apk/release/com.odweta.solon_$ver.apk
# create the tag
echo "\n[creating tag v$ver]\n"
echo
echo "[creating tag v$ver]"
echo
data_str='{ "tag_name": "'$ver'", "ref": "HEAD", "message": "Tagging release v'$ver'" }'
curl --request POST \
--header "PRIVATE-TOKEN: $glpat" \
@@ -43,14 +51,18 @@ curl --request POST \
"https://gitlab.com/api/v4/projects/47146187/releases"
# attach a file
echo "\n[attaching the release apk]\n"
echo
echo "[attaching the release apk]"
echo
asset_url="https://gitlab.com/-/project/47146187"$(curl --request POST \
--header "PRIVATE-TOKEN: $glpat" \
--form "file=@app/build/outputs/apk/release/com.odweta.solon_$ver.apk" \
"https://gitlab.com/api/v4/projects/47146187/uploads" | jq .url -r)
# add the file as a stable release asset
echo "\n[creating release asset]\n"
echo
echo "[creating release asset]"
echo
curl --request POST \
--header "PRIVATE-TOKEN: $glpat" \
--data name="app-release.apk" \