去掉firebase功能 #1041
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
paths-ignore: # 有時候不想要改個文档也触发 github actions | |
- '**.md' | |
- 'LICENSE' | |
tags-ignore: # 屏蔽掉发release打tag事件 | |
- '*' | |
branches: | |
- '*' | |
env: | |
IOT_SONATYPE_USERNAME: ${{ secrets.IOT_SONATYPE_USERNAME }} | |
IOT_SONATYPE_PASSWORD: ${{ secrets.IOT_SONATYPE_PASSWORD }} | |
GPG_DECRYPT_PASSPHRASE: ${{ secrets.GPG_DECRYPT_PASSPHRASE }} | |
IOT_WECOM_CID_ROBOT_KEY: ${{ secrets.IOT_WECOM_CID_ROBOT_KEY }} | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- run: | | |
rm -rf sdkdemo-config.json | |
gpg -d --passphrase "$GPG_DECRYPT_PASSPHRASE" --batch --quiet .github/sdkdemo/sdkdemo-config.json.asc > sdkdemo-config.json | |
- name: set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
# - name: Setup cmake | |
# uses: jwlawson/[email protected] | |
# with: | |
# cmake-version: '3.10.2' | |
- name: Use cmake | |
run: | | |
cmake --version | |
- name: install fir | |
run: sudo gem install fir-cli | |
- name: Fix App Version | |
run: | | |
rb=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
rc=$(git rev-parse --short HEAD) | |
video_tag=$(git describe --tags --match "*video*" --abbrev=0 HEAD) | |
link_tag=$(git describe --tags --match "v[0-9].[0-9].[0-9]" --abbrev=0 HEAD) | |
echo "latest_video_tag=$video_tag" >> $GITHUB_ENV | |
echo "latest_link_tag=$link_tag" >> $GITHUB_ENV | |
sed -i 's#def versionAppName.*#def versionAppName = \"'$rb'+git.'$rc'\"#g' config.gradle | |
sed -i 's#def versionSDKDemoName.*#def versionSDKDemoName = \"'$rb'+git.'$rc'\"#g' config.gradle | |
sed -i "s#xxx#$rb+git.$rc#g" config.gradle | |
- name: Update SDK Version | |
run: | | |
export LATEST_VIDEO_TAG=${{env.latest_video_tag}} | |
export LATEST_LINK_TAG=${{env.latest_link_tag}} | |
bash .github/scripts/updateVersionCodeForSnapshot.sh | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Package apk and aar with Gradle | |
run: ./gradlew assembleOpensource | |
- name: Publish aar to Maven | |
run: ./gradlew publish | |
- name: Archive the apk | |
uses: actions/upload-artifact@v2 | |
with: | |
path: app/build/outputs/apk/opensource/release/*.apk | |
- name: Build demo apk | |
run: | | |
./gradlew :sdkdemo:assembleRelease | |
- name: Deploy App to fir | |
run: | | |
apk=$(ls app/build/outputs/apk/opensource/release/*.apk) | |
demoApk=$(ls sdkdemo/build/outputs/apk/release/sdkdemo-release.apk) | |
rc=$(git rev-parse --short HEAD) | |
rl=$(git log --pretty=format:"%s" $rc -1) | |
fir publish $demoApk -T $IOT_FIRIM_API_TOKEN -c "$rl" --oversea_turbo --force_pin_history -V | |
env: | |
IOT_FIRIM_API_TOKEN: ${{ secrets.IOT_FIRIM_API_TOKEN }} | |
- name: Report success result to wecom | |
if: ${{ success() }} | |
run: | | |
echo success!!! | |
bash .github/scripts/send_result_to_wecom.sh ${{ github.event.repository.name }} success | |
- name: Report fail result to wecom | |
if: ${{ failure() }} | |
run: | | |
echo fail!!! | |
bash .github/scripts/send_result_to_wecom.sh ${{ github.event.repository.name }} fail |