Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Commit

Permalink
Refactoring to Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxSpins committed Nov 10, 2024
1 parent 75e9003 commit ba2e923
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 67 deletions.
17 changes: 16 additions & 1 deletion .androidide/editor/openedFiles.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
},
{
"file": "/storage/emulated/0/sakura/.github/workflows/android.yml",
"file": "/storage/emulated/0/sakura/.github/workflows/diffandroid.yml.txt",
"selection": {
"end": {
"column": 20,
Expand All @@ -59,6 +59,21 @@
"line": 61
}
}
},
{
"file": "/storage/emulated/0/sakura/.github/workflows/android.yml",
"selection": {
"end": {
"column": 28,
"index": 865,
"line": 41
},
"start": {
"column": 28,
"index": 865,
"line": 41
}
}
}
],
"selectedFile": "/storage/emulated/0/sakura/.github/workflows/android.yml"
Expand Down
76 changes: 10 additions & 66 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,18 @@ on:
workflow_dispatch:

jobs:
init:
name: Init
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: notify telegram
uses: EverythingSuckz/github-telegram-notify@main
continue-on-error: true
with:
bot_token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
chat_id: -1002355760766
topic_id: 11

build_release_apk:
name: Build App Debug APK
build:
name: Build Sakura
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'oracle'
cache: gradle

Expand All @@ -47,53 +32,12 @@ jobs:

- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4

- name: Build Sakura Debug
run: ./gradlew assembleDebug

- name: Build with Gradle
id: gradle_build_release
run: ./gradlew assembleRelease

- name: Upload release apk
- name: Upload release app
uses: actions/upload-artifact@v4
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk

send_debug_apk:
name: Send Debug APK
runs-on: ubuntu-latest
needs: build_debug_apk

steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Download debug apk
uses: actions/download-artifact@v4
with:
name: app-debug

- name: List repo contents
run: ls

- name: Get the last commit message
id: get_commit_msg
run: |
commit_message=$(git log -1 --pretty=format:'%s')
echo "message=$commit_message" >> $GITHUB_OUTPUT
- name: Rename file
run: |
mv app-debug.apk sakura-app-debug.apk
ls
- name: Send APK to Release Channel Telegram with Topic ID
if: success()
continue-on-error: true
run: |
curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument" \
-F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
-F message_thread_id="11" \
-F document=@"sparkles-app-release.apk" \
-F caption="${{ github.event.head_commit.message }} by ${{ github.actor }}"
name: Sakura-debug
path: app/build/outputs/apk/debug/
99 changes: 99 additions & 0 deletions .github/workflows/diffandroid.yml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Android CI

on:
push:
branches: [ "**" ]
paths-ignore:
- '**/*.md'
pull_request:
branches: [ "**" ]
paths-ignore:
- '**/*.md'
workflow_dispatch:

jobs:
init:
name: Init
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: notify telegram
uses: EverythingSuckz/github-telegram-notify@main
continue-on-error: true
with:
bot_token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
chat_id: -1002355760766
topic_id: 11

build_release_apk:
name: Build App Debug APK
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'oracle'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4

- name: Build with Gradle
id: gradle_build_release
run: ./gradlew assembleRelease

- name: Upload release apk
uses: actions/upload-artifact@v4
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk

send_debug_apk:
name: Send Debug APK
runs-on: ubuntu-latest
needs: build_debug_apk

steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Download debug apk
uses: actions/download-artifact@v4
with:
name: app-debug

- name: List repo contents
run: ls

- name: Get the last commit message
id: get_commit_msg
run: |
commit_message=$(git log -1 --pretty=format:'%s')
echo "message=$commit_message" >> $GITHUB_OUTPUT

- name: Rename file
run: |
mv app-debug.apk sakura-app-debug.apk
ls

- name: Send APK to Release Channel Telegram with Topic ID
if: success()
continue-on-error: true
run: |
curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument" \
-F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
-F message_thread_id="11" \
-F document=@"sparkles-app-release.apk" \
-F caption="${{ github.event.head_commit.message }} by ${{ github.actor }}"
Binary file modified .gradle/8.9/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/8.9/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/8.9/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/8.9/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.

0 comments on commit ba2e923

Please sign in to comment.