Created
January 7, 2021 11:31
-
-
Save nikartx/1f163945a80b1887284fc8b564161dfc to your computer and use it in GitHub Desktop.
Simple base CI/CD script, using Telegram bot to get application build status
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: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with tests | |
run: ./gradlew test | |
- name: Build with Gradle | |
run: ./gradlew assembleDebug | |
# Start create debug apk artifact | |
- name: Upload APK | |
uses: actions/upload-artifact@v2 | |
with: | |
name: appDebugBuild | |
path: app/build/outputs/apk/debug/app-debug.apk | |
# Start notify telegram bot | |
- name: Notify Telegram | |
uses: yanzay/[email protected] | |
with: | |
chat: bot_chat_id # Get chat id using terminal: curl https://api.telegram.org/bot{bot_token}/getUpdates | |
token: bot_token # Use Telegram @@BotFather | |
status: ${{ job.status }} # do not modify this line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment