Skip to content

bump version code

bump version code #34

Workflow file for this run

name: CI/CD
on:
push:
branches-ignore: [ master ]
pull_request:
branches-ignore: [ master ]
types: [ opened ]
jobs:
build:
name: Build and publish debug APK
runs-on: ubuntu-latest
steps:
- name: Set start time
id: start
run: |
echo "START_TIME=$(date +%s)" >> $GITHUB_ENV
- name: Checkout the repo
uses: actions/checkout@v3
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
- name: Execute Gradle build
run: ./gradlew buildDebug
- name: Assemble debug APK
run: ./gradlew assembleDebug
- name: Publish debug APK to Telegram
run: |
formatDuration() { # like 1m 1s
local ms=$1
m=$((ms / 60))
s=$((ms % 60));
echo $([ "$m" -gt 0 ] && echo "${m}m ")${s} s;
}
TELEGRAM_BOT_TOKEN=${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID=${{ secrets.TELEGRAM_CHAT_ID }}
FILE_PATH=$(find ./app/build/outputs/apk/debug/ -name '*.apk' | head -n 1)
THUMBNAIL_PATH="./assets/logo-320.jpg"
DURATION=$(( $(date +%s) - $START_TIME ))
CAPTION="${{ github.head_ref || github.ref_name }}"$'\n'"[$(formatDuration $DURATION)]"
curl --silent --show-error -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendDocument" \
-F chat_id="$TELEGRAM_CHAT_ID" \
-F document=@"$FILE_PATH" \
-F thumb=@"$THUMBNAIL_PATH" \
-F caption="$CAPTION"