[Android] Fix the maven deployment script

Nicolas Pomepuy git at videolan.org
Thu Dec 5 06:57:32 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Dec  5 07:44:30 2024 +0100| [63ffcb693ce9485be05160fd75286264dee53a7a] | committer: Nicolas Pomepuy

Fix the maven deployment script

> https://code.videolan.org/videolan/vlc-android/commit/63ffcb693ce9485be05160fd75286264dee53a7a
---

 buildsystem/maven/deploy-to-mavencentral.sh | 40 ++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 4 deletions(-)

diff --git a/buildsystem/maven/deploy-to-mavencentral.sh b/buildsystem/maven/deploy-to-mavencentral.sh
index 3385b49442..991759abe7 100755
--- a/buildsystem/maven/deploy-to-mavencentral.sh
+++ b/buildsystem/maven/deploy-to-mavencentral.sh
@@ -6,6 +6,7 @@ set -euo pipefail
 OUTPUT_DIR="artifacts"
 MEDIALIB_VERSION=""
 LIBVLC_VERSION=""
+REMOTE_ACCESS_VERSION=""
 
 # Utilities
 function escape_pom() {
@@ -28,6 +29,11 @@ function red() {
   echo -e "\033[1;31m===================\n$1\n===================\033[0m"
 }
 
+function cleanup {
+  echo "Removing settings"
+  rm settings.xml
+}
+
 if [ $# -eq 0 ]
   then
     red "The file path has not been specified."
@@ -66,7 +72,13 @@ else
   red "Cannot find the libvlc directory"
 fi
 
-purple "The following versions have been found.\nlibvlc: $LIBVLC_VERSION\nmedialibrary: $MEDIALIB_VERSION."
+if test -d "$OUTPUT_DIR/aars/repository/org/videolan/android/remote-access"; then
+  REMOTE_ACCESS_VERSION=$(ls -tUd "$OUTPUT_DIR/aars/repository/org/videolan/android/remote-access/"*/ | xargs basename)
+else
+  red "Cannot find the remote access directory"
+fi
+
+purple "The following versions have been found.\nlibvlc: $LIBVLC_VERSION\nmedialibrary: $MEDIALIB_VERSION\nremote access: $REMOTE_ACCESS_VERSION"
 read -sp "Continue: y/N" -n 1 -r
 echo
 
@@ -76,12 +88,14 @@ fi
 
 blue "Ready to deploy"
 
-read -sp 'Enter the token password: ' pass
+read -sp 'Enter the zip password: ' pass
 echo
 TOKEN_PASSWORD=$(xml_encode $pass)
 
 blue "Setup Maven credentials"
-gpg --output settings.xml --batch -d --passphrase $TOKEN_PASSWORD settings.xml.gpg
+unzip -P $pass settings.xml.zip
+trap cleanup EXIT
+
 
 if [ -z "$LIBVLC_VERSION" ]; then
   purple "No version for libvlc. Skipping"
@@ -119,4 +133,22 @@ else
     -DrepositoryId=ossrh
 fi
 
-rm settings.xml
+if [ -z "$REMOTE_ACCESS_VERSION" ]; then
+  purple "No version for remote access Skipping"
+else
+  BASE_DIR="$OUTPUT_DIR/aars/repository/org/videolan/android/remote-access/$REMOTE_ACCESS_VERSION"
+  blue "Deploying $BASE_DIR"
+
+  mvn gpg:sign-and-deploy-file \
+    --settings settings.xml \
+    -DpomFile=$BASE_DIR/remote-access-$REMOTE_ACCESS_VERSION.pom \
+    -Dfile=$BASE_DIR/remote-access-$REMOTE_ACCESS_VERSION.aar \
+    -Dsources=$BASE_DIR/remote-access-$REMOTE_ACCESS_VERSION-sources.jar \
+    -Djavadoc=$BASE_DIR/remote-access-$REMOTE_ACCESS_VERSION-javadoc.jar \
+    -Durl="https://s01.oss.sonatype.org/service/local/staging/deploy/maven2" \
+    -DgroupId=org.videolan.android \
+    -Dgpg.keyname=49A7E6FE58DCF183F0B349DFB83763AD62ED0721 \
+    -DrepositoryId=ossrh
+fi
+
+



More information about the Android mailing list