Merge pull request #122 from TeamAmaze/security-policy #172
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 Main CI | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'release/*' | |
concurrency: | |
group: build-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check_spotless: | |
name: Check spotless | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: 11 | |
- name: Check formatting using spotless | |
uses: gradle/gradle-build-action@v2.4.2 | |
with: | |
arguments: spotlessCheck | |
build: | |
name: Build debug | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: 11 | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@v2.4.2 | |
with: | |
arguments: assembledebug | |
env: | |
TZ: UTC | |
- name: Publish on Telegram | |
run: | | |
COMMIT_COUNT=$(git rev-list --count ${GITHUB_REF}) | |
working_dir=$PWD | |
cd app/build/outputs/apk/fdroid/debug | |
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on app-fdroid-arm64-v8a-debug.7z app-fdroid-arm64-v8a-debug.apk | |
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on app-fdroid-armeabi-v7a-debug.7z app-fdroid-armeabi-v7a-debug.apk | |
cp app-fdroid-arm64-v8a-debug.7z amaze-utils-fdroid-arm64-v8a-v0.1-$(echo $COMMIT_COUNT).7z | |
cp app-fdroid-armeabi-v7a-debug.7z amaze-utils-fdroid-armeabi-v7a-v0.1-$(echo $COMMIT_COUNT).7z | |
echo $(curl -v -F "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" --header "Content-Type: multipart/form-data" -F document=@amaze-utils-fdroid-arm64-v8a-v0.1-$(echo $COMMIT_COUNT).7z https://api.telegram.org/${{ secrets.AMAZE_BOT_ID }}:${{ secrets.TELEGRAM_INTEGRATION_KEY }}/sendDocument) | |
echo $(curl -v -F "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" --header "Content-Type: multipart/form-data" -F document=@amaze-utils-fdroid-armeabi-v7a-v0.1-$(echo $COMMIT_COUNT).7z https://api.telegram.org/${{ secrets.AMAZE_BOT_ID }}:${{ secrets.TELEGRAM_INTEGRATION_KEY }}/sendDocument) | |
cd $working_dir | |
cd app/build/outputs/apk/play/debug | |
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on app-play-arm64-v8a-debug.7z app-play-arm64-v8a-debug.apk | |
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on app-play-armeabi-v7a-debug.7z app-play-armeabi-v7a-debug.apk | |
cp app-play-arm64-v8a-debug.7z amaze-utils-play-arm64-v8a-v0.1-$(echo $COMMIT_COUNT).7z | |
cp app-play-armeabi-v7a-debug.7z amaze-utils-play-armeabi-v7a-v0.1-$(echo $COMMIT_COUNT).7z | |
echo $(curl -v -F "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" --header "Content-Type: multipart/form-data" -F document=@amaze-utils-play-arm64-v8a-v0.1-$(echo $COMMIT_COUNT).7z https://api.telegram.org/${{ secrets.AMAZE_BOT_ID }}:${{ secrets.TELEGRAM_INTEGRATION_KEY }}/sendDocument) | |
echo $(curl -v -F "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" --header "Content-Type: multipart/form-data" -F document=@amaze-utils-play-armeabi-v7a-v0.1-$(echo $COMMIT_COUNT).7z https://api.telegram.org/${{ secrets.AMAZE_BOT_ID }}:${{ secrets.TELEGRAM_INTEGRATION_KEY }}/sendDocument) |