Set up automatic android snapshot publishing

Summary:
Set up automatic publishing to Maven Snapshots if the current
VERSION_NAME ends in `-SNAPSHOT`.

Reviewed By: danielbuechele

Differential Revision: D9539838

fbshipit-source-id: 6e413fa3b02966946bb867eebe7ba8b863f291b9
This commit is contained in:
Pascal Hartig
2018-08-29 07:02:35 -07:00
committed by Facebook Github Bot
parent 52fe553e21
commit 91b6cf1c6a
3 changed files with 23 additions and 0 deletions

View File

@@ -90,3 +90,9 @@ matrix:
- cd ../ - cd ../
script: script:
- ./gradlew :sample:build - ./gradlew :sample:build
deploy:
- provider: script
script: "scripts/publish-android-snapshot.sh"
skip_cleanup: true
on:
branch: master

View File

@@ -0,0 +1 @@
Salted__<EFBFBD>9<EFBFBD><EFBFBD><EFBFBD>L<19>%Y<>b<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD>(<28><>M<EFBFBD><4D><01><><EFBFBD><EFBFBD>i<><69>B<EFBFBD><42>b<EFBFBD><62>[P<><50><1D> '\<5C>r<EFBFBD><72><EFBFBD>r<EFBFBD><72>l,s<><73><0E>W<><57>kPc9<63>ڦ!<21>%p<>"<22><>~<7E>=<3D>rTnM3<><33>&<26><><<3C><>z<><7A>?<3F>-<2D>v$<24>57<35>bW,

View File

@@ -0,0 +1,16 @@
#!/usr/bin/bash
set -e
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
IS_SNAPSHOT="$(grep 'VERSION_NAME=[0-9\.]\+-SNAPSHOT' "$BASEDIR/gradle.properties")"
if [ "$ANDROID_PUBLISH_KEY" == "" ]; then
echo "No encryption key. Skipping snapshot deployment."
exit
elif [ "$IS_SNAPSHOT" == "" ]; then
echo "Skipping build. Given build doesn't appear to be a SNAPSHOT release."
exit 1
else
openssl aes-256-cbc -d -in scripts/gradle-publish-keys.enc -k "$ANDROID_PUBLISH_KEY" >> "$BASEDIR/gradle.properties"
"$BASEDIR"/gradlew uploadArchives --info
fi