You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

release-sdk.sh 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. set -e -u
  3. THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
  4. DEFAULT_MVN_REPO="${THIS_DIR}/../../../jitsi-maven-repository/releases"
  5. export MVN_REPO=$(realpath ${1:-$DEFAULT_MVN_REPO})
  6. SDK_VERSION=$(grep sdkVersion ${THIS_DIR}/../gradle.properties | cut -d"=" -f2)
  7. RN_VERSION=$(jq -r '.dependencies."react-native"' ${THIS_DIR}/../../package.json)
  8. echo "Releasing Jitsi Meet SDK ${SDK_VERSION}"
  9. echo "Using ${MVN_REPO} as the Maven repo"
  10. # Check if an SDK with that same version has already been released
  11. if [[ -d ${MVN_REPO}/org/jitsi/react/jitsi-meet-sdk/${SDK_VERSION} ]]; then
  12. echo "There is already a release with that version in the Maven repo!"
  13. exit 1
  14. fi
  15. # First push React Native, if necessary
  16. if [[ ! -d ${MVN_REPO}/com/facebook/react/react-native/${RN_VERSION} ]]; then
  17. echo "Pushing React Native ${RN_VERSION} to the Maven repo"
  18. pushd ${THIS_DIR}/../../node_modules/react-native/android/com/facebook/react/react-native/${RN_VERSION}
  19. mvn \
  20. deploy:deploy-file \
  21. -Durl=file://${MVN_REPO} \
  22. -Dfile=react-native-${RN_VERSION}.aar \
  23. -Dpackaging=aar \
  24. -DgeneratePom=false \
  25. -DpomFile=react-native-${RN_VERSION}.pom
  26. popd
  27. fi
  28. # Now build and publish the Jitsi Meet SDK and its dependencies
  29. echo "Building and publishing the Jitsi Meet SDK"
  30. pushd ${THIS_DIR}/../
  31. ./gradlew clean assembleRelease publish
  32. popd
  33. # The artifacts are now on the Maven repo, commit them
  34. pushd ${MVN_REPO}
  35. if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" == "true" ]]; then
  36. git add -A .
  37. git commit -m "Jitsi Meet SDK + dependencies"
  38. fi
  39. popd
  40. # Tag the release
  41. git tag -a android-sdk-${SDK_VERSION}
  42. # Done!
  43. echo "Finished! Don't forget to push the tag and the Maven repo artifacts."