Remove Logs Screen #582
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: Build CI | |
on: | |
push: | |
branches: [ master, rCompatible, rCompatible-Dev ] | |
workflow_dispatch: | |
concurrency: | |
group: 'ci-build' | |
cancel-in-progress: true | |
jobs: | |
buildMaster: | |
name: Build Ci APK from master | |
if: startsWith(github.ref, 'refs/heads/master') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.31.1' | |
- name: Setup Ninja | |
run: sudo apt-get install ninja-build | |
- name: Ninja Version | |
run: ninja --version | |
- uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: r27c | |
- name: Get Commit Message | |
id: commitMessage | |
run: IN="${{ github.event.head_commit.message }}" && echo "message=${IN%%$'\n'*}" >> $GITHUB_OUTPUT | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 23 | |
distribution: temurin | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
!~/.gradle/caches/build-cache-* | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }} | |
restore-keys: ${{ runner.os }}-gradle- | |
- name: Cache build cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ github.workspace }}/.ccache | |
~/.gradle/caches/build-cache-* | |
key: ${{ runner.os }}-build-cache-${{ github.sha }} | |
restore-keys: ${{ runner.os }}-build-cache- | |
- name: Extract branch name | |
shell: bash | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: File Permissions | |
run: chmod +x gradlew | |
- name: Accept Preview SDK License | |
run: echo -n -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > /usr/local/lib/android/sdk/licenses/android-sdk-preview-license | |
- name: Build apk | |
id: buildAllApks | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
gradle-version: wrapper | |
- name: AssembleDebug the project | |
run: ./gradlew assembleDebug | |
- name: Get JSON | |
id: metadataJson | |
run: | | |
echo "json=$(cat app/build/outputs/apk/debug/output-metadata.json | jq -c .)" >> $GITHUB_OUTPUT | |
- name: Sign artifact | |
id: signArtifact | |
uses: ilharp/sign-android-release@v1.0.4 | |
with: | |
releaseDir: app/build/outputs/apk/debug | |
keyAlias: ${{ secrets.KEYALIAS }} | |
signingKey: ${{ secrets.SIGNING_KEY }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
buildToolsVersion: '36.0.0-rc3' | |
- name: Delete old APK | |
run: rm app/build/outputs/apk/debug/app-debug.apk | |
- name: Rename APK | |
run: mv app/build/outputs/apk/debug/app-debug-signed.apk app/build/outputs/apk/debug/app-debug.apk | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Debug Artifact | |
path: app/build/outputs/apk/debug/app-debug.apk | |
- name: Create new Release | |
id: create_release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
automatic_release_tag: ${{ fromJson(steps.metadataJson.outputs.json).elements[0].versionName }}-debug | |
prerelease: true | |
title: Rboard Manager Development ${{ fromJson(steps.metadataJson.outputs.json).elements[0].versionName }} | |
files: | | |
app/build/outputs/apk/debug/app-debug.apk | |
app/build/outputs/apk/debug/output-metadata.json | |
- name: Create new Release | |
id: create_latest_release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
automatic_release_tag: latest-debug | |
prerelease: true | |
title: Rboard Manager Development ${{ fromJson(steps.metadataJson.outputs.json).elements[0].versionName }} | |
files: | | |
app/build/outputs/apk/debug/app-debug.apk | |
app/build/outputs/apk/debug/output-metadata.json | |
- name: Send Telegram message | |
run: "curl --location --request POST 'https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage' --header 'Content-Type:application/json' --data-raw '{\"chat_id\":\"${{ secrets.TELEGRAM_TO_MAIN }}\",\"message_thread_id\":${{ secrets.TELEGRAM_MAIN_TOPIC_ID_DEBUG }},\"text\":\"#A12\\n**${{ steps.extract_branch.outputs.BRANCH_NAME }}**\\n\\ncommit: `${{ github.event.head_commit.message }}` [${{ github.event.head_commit.id }}](${{ github.event.head_commit.url }})\",\"parse_mode\":\"markdown\",\"reply_markup\":{\"inline_keyboard\":[[{\"text\":\"Download A12+\",\"url\":\"https://github.com/DerTyp7214/RboardThemeManagerV3/releases/download/${{ fromJson(steps.metadataJson.outputs.json).elements[0].versionName }}-debug/app-debug.apk\"}]]}}'" | |
- name: Send Notification | |
continue-on-error: true | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: 'https://fcm.googleapis.com/fcm/send' | |
method: 'POST' | |
customHeaders: '{"Authorization":"key=${{ secrets.FCM_KEY }}"}' | |
data: '{"to": "/topics/update-v3-debug","data": {"version": ${{ fromJson(steps.metadataJson.outputs.json).elements[0].versionCode }},"type": "update","notification": {"body": "Update available. ${{ steps.commitMessage.outputs.message }}","title": "Update"}}}' |