您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

release-sdk.sh 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. THE_MVN_REPO=${MVN_REPO:-${1:-$DEFAULT_MVN_REPO}}
  6. MVN_HTTP=0
  7. DEFAULT_SDK_VERSION=$(grep sdkVersion ${THIS_DIR}/../gradle.properties | cut -d"=" -f2)
  8. SDK_VERSION=${OVERRIDE_SDK_VERSION:-${DEFAULT_SDK_VERSION}}
  9. RN_VERSION=$(jq -r '.dependencies."react-native"' ${THIS_DIR}/../../package.json)
  10. DO_GIT_TAG=${GIT_TAG:-0}
  11. if [[ $THE_MVN_REPO == http* ]]; then
  12. MVN_HTTP=1
  13. else
  14. MVN_REPO_PATH=$(realpath $THE_MVN_REPO)
  15. THE_MVN_REPO="file:${MVN_REPO_PATH}"
  16. fi
  17. export MVN_REPO=$THE_MVN_REPO
  18. echo "Releasing Jitsi Meet SDK ${SDK_VERSION}"
  19. echo "Using ${MVN_REPO} as the Maven repo"
  20. if [[ $MVN_HTTP == 1 ]]; then
  21. # Push React Native
  22. echo "Pushing React Native ${RN_VERSION} to the Maven repo"
  23. pushd ${THIS_DIR}/../../node_modules/react-native/android/com/facebook/react/react-native/${RN_VERSION}
  24. mvn \
  25. deploy:deploy-file \
  26. -Durl=${MVN_REPO} \
  27. -DrepositoryId=${MVN_REPO_ID} \
  28. -Dfile=react-native-${RN_VERSION}.aar \
  29. -Dpackaging=aar \
  30. -DgeneratePom=false \
  31. -DpomFile=react-native-${RN_VERSION}.pom || true
  32. popd
  33. else
  34. # Check if an SDK with that same version has already been released
  35. if [[ -d ${MVN_REPO}/org/jitsi/react/jitsi-meet-sdk/${SDK_VERSION} ]]; then
  36. echo "There is already a release with that version in the Maven repo!"
  37. exit 1
  38. fi
  39. # First push React Native, if necessary
  40. if [[ ! -d ${MVN_REPO}/com/facebook/react/react-native/${RN_VERSION} ]]; then
  41. echo "Pushing React Native ${RN_VERSION} to the Maven repo"
  42. pushd ${THIS_DIR}/../../node_modules/react-native/android/com/facebook/react/react-native/${RN_VERSION}
  43. mvn \
  44. deploy:deploy-file \
  45. -Durl=${MVN_REPO} \
  46. -Dfile=react-native-${RN_VERSION}.aar \
  47. -Dpackaging=aar \
  48. -DgeneratePom=false \
  49. -DpomFile=react-native-${RN_VERSION}.pom
  50. popd
  51. fi
  52. fi
  53. # Now build and publish the Jitsi Meet SDK and its dependencies
  54. echo "Building and publishing the Jitsi Meet SDK"
  55. pushd ${THIS_DIR}/../
  56. ./gradlew clean assembleRelease publish
  57. popd
  58. if [[ $DO_GIT_TAG == 1 ]]; then
  59. # The artifacts are now on the Maven repo, commit them
  60. pushd ${MVN_REPO_PATH}
  61. git add -A .
  62. git commit -m "Jitsi Meet SDK + dependencies: ${SDK_VERSION}"
  63. popd
  64. # Tag the release
  65. git tag android-sdk-${SDK_VERSION}
  66. fi
  67. # Done!
  68. echo "Finished! Don't forget to push the tag and the Maven repo artifacts."