tencentyun/iot-p2p@ced4ca16 #481
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 App&Device Combine CI | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
- 'LICENSE' | |
env: | |
IOT_SONATYPE_USERNAME: ${{ secrets.IOT_SONATYPE_USERNAME }} | |
IOT_SONATYPE_PASSWORD: ${{ secrets.IOT_SONATYPE_PASSWORD }} | |
GPG_DECRYPT_PASSPHRASE: ${{ secrets.GPG_DECRYPT_PASSPHRASE }} | |
IOT_GPG_KEYNAME: ${{ secrets.IOT_GPG_KEYNAME }} | |
IOT_GPG_PASSPHRASE: ${{ secrets.IOT_GPG_PASSPHRASE }} | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.17.0' | |
- name: Use cmake | |
run: echo +++++$(cmake --version) | |
- name: Setup NDK | |
run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;16.1.4479499" | |
- name: build libenet debug | |
if: startsWith(github.event.ref, 'refs/heads') | |
run: | | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
export GIT_BRANCH_IMAGE_VERSION=$VERSION | |
sh .github/script/build_android_combine.sh Debug | |
env: | |
GIT_ACCESS_TOKEN: ${{ secrets.IOT_GITHUB_ACCESS_TOKEN }} | |
PROVISIONING_PASSWORD: ${{ secrets.GPG_DECRYPT_PASSPHRASE }} | |
- name: build libenet release | |
if: startsWith(github.event.ref, 'refs/tags') | |
run: | | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
export GIT_BRANCH_IMAGE_VERSION=$VERSION | |
sh .github/script/build_android_combine.sh Release | |
env: | |
GIT_ACCESS_TOKEN: ${{ secrets.IOT_GITHUB_ACCESS_TOKEN }} | |
PROVISIONING_PASSWORD: ${{ secrets.GPG_DECRYPT_PASSPHRASE }} | |
- name: Compress xp2p artifacts | |
run: | | |
mkdir xp2p_artifacts | |
cp -r iot-p2p/iot/device/android_device/device_video_aar/explorer-device-video-sdk/libs/ xp2p_artifacts/ | |
zip -r xp2p_artifacts.zip xp2p_artifacts | |
- name: Upload .so to Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: xp2p | |
path: | | |
xp2p_artifacts.zip | |
- name: Update sdk version debug | |
if: startsWith(github.event.ref, 'refs/heads') | |
run: | | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
export GIT_BRANCH_IMAGE_VERSION=$VERSION | |
bash .github/script/update_version_for_android.sh Debug iot-p2p/iot/device/android_device/device_video_aar/explorer-device-video-sdk/build.gradle | |
- name: Update sdk version release | |
if: startsWith(github.event.ref, 'refs/tags') | |
run: | | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
export GIT_BRANCH_IMAGE_VERSION=$VERSION | |
bash .github/script/update_version_for_android.sh Release iot-p2p/iot/device/android_device/device_video_aar/explorer-device-video-sdk/build.gradle | |
- name: Update Values of Signing | |
run: | | |
export KEY_ID_OF_SIGN=$IOT_GPG_KEYNAME | |
export PASSWORD_OF_SIGN=$IOT_GPG_PASSPHRASE | |
sh .github/script/update_values_for_sign.sh iot-p2p/iot/device/android_device/device_video_aar/gradle.properties | |
- name: Build with Gradle | |
run: | | |
gpg -d --passphrase "$GPG_DECRYPT_PASSPHRASE" --batch --quiet .github/file/secring.gpg.asc > secring.gpg | |
chmod -R 777 iot-p2p/iot/device/android_device/device_video_aar/ | |
cd iot-p2p/iot/device/android_device/device_video_aar/ | |
./gradlew build | |
- name: Publish aar to Maven | |
run: | | |
chmod -R 777 iot-p2p/iot/device/android_device/device_video_aar/ | |
cd iot-p2p/iot/device/android_device/device_video_aar/ | |
./gradlew publish |