This repository has been archived by the owner on Dec 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75e9003
commit ba2e923
Showing
9 changed files
with
125 additions
and
67 deletions.
There are no files selected for viewing
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
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
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
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.