-
Notifications
You must be signed in to change notification settings - Fork 5
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
f82eb3b
commit c5e5edd
Showing
1 changed file
with
52 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Test Release Master | ||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get the source | ||
uses: actions/[email protected] | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- 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: Rename APK | ||
run: mv ${{ steps.sign_app.outputs.signedReleaseFile }} app/build/outputs/apk/release/showcase\(master\)${{ github.run_number }}.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=@app/build/outputs/apk/release/showcase\(master\)${{ github.run_number }}.apk |