Skip to content

Commit

Permalink
Create test_release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
WirelessAlien authored Jan 1, 2025
1 parent 4b7bb4e commit a127e03
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Test Release
on:
pull_request:
types: [opened]
push:
branches:
- master
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get the source
uses: actions/checkout@v4.2.2

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Cache Gradle dependencies
uses: actions/cache@v4.1.2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Generate Release APK
run: ./gradlew assembleRelease

- name: Sign APK
uses: r0adkll/sign-android-release@v1
id: sign_app
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.KEYSTORE_FILE }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "34.0.0"

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

- name: Install curl
run: sudo apt-get install -y curl

- name: Upload APK to Telegram
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
run: |
curl -X POST "https://api.telegram.org/bot${{ env.TELEGRAM_BOT_TOKEN }}/sendDocument" \
-F chat_id=${{ env.TELEGRAM_CHAT_ID }} \
-F document=@${{ steps.sign_app.outputs.signedReleaseFile }}

0 comments on commit a127e03

Please sign in to comment.