"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-5079/android/scripts/release-sdk.sh" (17 Jun 2021, 3801 Bytes) of package /linux/misc/jitsi-meet-5079.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 
    3 set -e -u
    4 
    5 
    6 THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
    7 DEFAULT_MVN_REPO="${THIS_DIR}/../../../jitsi-maven-repository/releases"
    8 THE_MVN_REPO=${MVN_REPO:-${1:-$DEFAULT_MVN_REPO}}
    9 MVN_HTTP=0
   10 DEFAULT_SDK_VERSION=$(grep sdkVersion ${THIS_DIR}/../gradle.properties | cut -d"=" -f2)
   11 SDK_VERSION=${OVERRIDE_SDK_VERSION:-${DEFAULT_SDK_VERSION}}
   12 RN_VERSION=$(jq -r '.version' ${THIS_DIR}/../../node_modules/react-native/package.json)
   13 JSC_VERSION="r"$(jq -r '.dependencies."jsc-android"' ${THIS_DIR}/../../node_modules/react-native/package.json | cut -d . -f 1 | cut -c 2-)
   14 DO_GIT_TAG=${GIT_TAG:-0}
   15 
   16 if [[ $THE_MVN_REPO == http* ]]; then
   17     MVN_HTTP=1
   18 else
   19     MVN_REPO_PATH=$(realpath $THE_MVN_REPO)
   20     THE_MVN_REPO="file:${MVN_REPO_PATH}"
   21 fi
   22 
   23 export MVN_REPO=$THE_MVN_REPO
   24 
   25 echo "Releasing Jitsi Meet SDK ${SDK_VERSION}"
   26 echo "Using ${MVN_REPO} as the Maven repo"
   27 
   28 if [[ $MVN_HTTP == 1 ]]; then
   29     # Push React Native
   30     echo "Pushing React Native ${RN_VERSION} to the Maven repo"
   31     pushd ${THIS_DIR}/../../node_modules/react-native/android/com/facebook/react/react-native/${RN_VERSION}
   32     mvn \
   33         deploy:deploy-file \
   34         -Durl=${MVN_REPO} \
   35         -DrepositoryId=${MVN_REPO_ID} \
   36         -Dfile=react-native-${RN_VERSION}.aar \
   37         -Dpackaging=aar \
   38         -DgeneratePom=false \
   39         -DpomFile=react-native-${RN_VERSION}.pom || true
   40     popd
   41     # Push JSC
   42     echo "Pushing JSC ${JSC_VERSION} to the Maven repo"
   43     pushd ${THIS_DIR}/../../node_modules/jsc-android/dist/org/webkit/android-jsc/${JSC_VERSION}
   44     mvn \
   45         deploy:deploy-file \
   46         -Durl=${MVN_REPO} \
   47         -DrepositoryId=${MVN_REPO_ID} \
   48         -Dfile=android-jsc-${JSC_VERSION}.aar \
   49         -Dpackaging=aar \
   50         -DgeneratePom=false \
   51         -DpomFile=android-jsc-${JSC_VERSION}.pom || true
   52     popd
   53 else
   54     # Push React Native, if necessary
   55     if [[ ! -d ${MVN_REPO}/com/facebook/react/react-native/${RN_VERSION} ]]; then
   56         echo "Pushing React Native ${RN_VERSION} to the Maven repo"
   57         pushd ${THIS_DIR}/../../node_modules/react-native/android/com/facebook/react/react-native/${RN_VERSION}
   58         mvn \
   59             deploy:deploy-file \
   60             -Durl=${MVN_REPO} \
   61             -Dfile=react-native-${RN_VERSION}.aar \
   62             -Dpackaging=aar \
   63             -DgeneratePom=false \
   64             -DpomFile=react-native-${RN_VERSION}.pom
   65         popd
   66     fi
   67 
   68     # Push JSC, if necessary
   69     if [[ ! -d ${MVN_REPO}/org/webkit/android-jsc/${JSC_VERSION} ]]; then
   70         echo "Pushing JSC ${JSC_VERSION} to the Maven repo"
   71         pushd ${THIS_DIR}/../../node_modules/jsc-android/dist/org/webkit/android-jsc/${JSC_VERSION}
   72         mvn \
   73             deploy:deploy-file \
   74             -Durl=${MVN_REPO} \
   75             -Dfile=android-jsc-${JSC_VERSION}.aar \
   76             -Dpackaging=aar \
   77             -DgeneratePom=false \
   78             -DpomFile=android-jsc-${JSC_VERSION}.pom
   79         popd
   80     fi
   81 
   82     # Check if an SDK with that same version has already been released
   83     if [[ -d ${MVN_REPO}/org/jitsi/react/jitsi-meet-sdk/${SDK_VERSION} ]]; then
   84         echo "There is already a release with that version in the Maven repo!"
   85         exit 1
   86     fi
   87 fi
   88 
   89 # Now build and publish the Jitsi Meet SDK and its dependencies
   90 echo "Building and publishing the Jitsi Meet SDK"
   91 pushd ${THIS_DIR}/../
   92 ./gradlew clean 
   93 ./gradlew assembleRelease 
   94 ./gradlew publish
   95 popd
   96 
   97 if [[ $DO_GIT_TAG == 1 ]]; then
   98     # The artifacts are now on the Maven repo, commit them
   99     pushd ${MVN_REPO_PATH}
  100     git add -A .
  101     git commit -m "Jitsi Meet SDK + dependencies: ${SDK_VERSION}"
  102     popd
  103 
  104     # Tag the release
  105     git tag android-sdk-${SDK_VERSION}
  106 fi
  107 
  108 # Done!
  109 echo "Finished! Don't forget to push the tag and the Maven repo artifacts."