Fix Notification Permissions #370
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: [ "kotlin" ] | |
pull_request: | |
branches: [ "kotlin" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Initialize repo | |
run: | | |
git config --global user.name "sounddrill31" | |
git config --global user.email "sounddrill31@gmail.com" | |
id: pwd | |
- name: Versioning | |
run: | | |
sed -i "s/private val buildRunId: Long = 0/private val buildRunId: Long = ${{ github.run_id }}/" app/src/main/java/com/zeusinstitute/upiapp/Update.kt | |
grep "private val buildRunId" app/src/main/java/com/zeusinstitute/upiapp/Update.kt | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew assembleDebug | |
- name: Get Build Tool Version | |
shell: bash | |
run: | | |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) | |
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV | |
echo Last build tool version is: $BUILD_TOOL_VERSION | |
- name: Sign apk | |
uses: r0adkll/sign-android-release@v1 | |
id: sign_app | |
with: | |
releaseDirectory: app/build/outputs/apk/debug | |
signingKeyBase64: ${{ secrets.SIGNINGKEYBASE64 }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: App-Artifact | |
path: | | |
app/build/outputs/apk/*/*.apk | |
- name: Upload to Release | |
uses: xresloader/upload-to-github-release@v1 | |
with: | |
file: | | |
app/build/outputs/apk/*/*.apk | |
default_release_name: kotlin ${{ github.pull_request_target }} ${{ github.run_id }} | |
tag_name: ${{ github.run_id }} ${{ github.pull_request_target }} | |
draft: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |