Bump version to v1.1.0 #16
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: Debug Build | |
on: | |
push: | |
branches: | |
- 'master' | |
paths-ignore: | |
- 'README.md' | |
pull_request: | |
branches: [ master ] | |
paths-ignore: | |
- 'README.md' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone the repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 20 | |
cache: 'gradle' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Get app version | |
run: echo "APP_VERSION=v$(cat ./app/build.gradle | grep -m1 versionName | awk -F \" '{print $2}')" >> $GITHUB_ENV | |
- name: Get app name | |
run: echo "APP_NAME=BatteryChargeLimiter_${{ env.APP_VERSION }}-DEBUG#${{ github.run_number }}" >> $GITHUB_ENV | |
- name: Inject run number | |
run: sed -i -e 's|versionName "\([0-9\.]\+\)"|versionName "\1-${{ github.run_number }}"|' ./app/build.gradle | |
- name: Build with Gradle | |
run: ./gradlew packageDebugUniversalApk | |
- name: Rename the APK file | |
run: mv ./app/build/outputs/apk_from_bundle/debug/app-debug-universal.apk ./${{ env.APP_NAME }}.apk | |
- name: Store generated APK file | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{ env.APP_NAME }} | |
path: ./${{ env.APP_NAME }}.apk | |
- name: Upload APK to telegram | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
document: ./${{ env.APP_NAME }}.apk | |
format: markdown | |
message: | | |
*BCL Debug ${{ env.APP_VERSION }} Run#${{ github.run_number }}* | |
${{ github.event.head_commit.message }} | |
continue-on-error: true |