Skip to content

Update project

Update project #136

name: Distribution App
on:
push:
branches: [ master ]
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
TMDB_API_KEY: ${{ secrets.TMDB_API_KEY }}
concurrency:
group: environment-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Make Gradlew Executable
run: chmod +x ./gradlew
- name: Decode Keystore File
id: decode_keystore_file
uses: timheuer/base64-to-file@v1
with:
fileName: 'keystore_release.jks'
encodedString: ${{ secrets.KEYSTORE_FILE }}
- name: Set Decoded File Location as Environment
run: echo "KEYSTORE_FILE=${{ steps.decode_keystore_file.outputs.filePath }}" >> $GITHUB_ENV
- name: Build Debug Artifacts
run: ./gradlew assembleDebug
- name: Build Release Artifacts
run: ./gradlew assembleRelease
- name: Build Bundle Artifacts
run: ./gradlew bundleRelease
- name: Upload Artifacts to Outputs
uses: actions/upload-artifact@v2
with:
path: |
app/build/outputs/apk
app/build/outputs/bundle
# - name: Create GitHub Release
# uses: softprops/action-gh-release@v1
# with:
# name: ${{ env.ANDROID_VERSION_NAME }}
# tag_name: ${{ env.ANDROID_VERSION_NAME }}
# draft: false
# prerelease: false
# files: |
# app/build/outputs/apk/**/*.apk
# app/build/outputs/bundle/**/*.aab
- name: Distribute Artifacts via Firebase
run: ./gradlew appDistributionUploadRelease
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
# - name: Create Service Account JSON File
# run: echo '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}' > service_account.json
# - name: Upload Bundle to Google Play Console
# uses: sokchanbo/[email protected]
# with:
# service-account: service_account.json
# package-name: org.michaelbel.template
# release-file: app/build/outputs/bundle/**/*.aab
# track: internal
- name: Telegram Message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
disable_notification: false
disable_web_page_preview: true
document: app/build/outputs/apk/**/*.apk
message_file: ./releaseNotes.txt