2021-03-26 18:21:51 +00:00
|
|
|
name: Github pre-release
|
2021-03-25 15:05:38 +00:00
|
|
|
|
|
|
|
on: workflow_dispatch
|
|
|
|
# push:
|
|
|
|
# branches: [ master ]
|
|
|
|
# pull_request:
|
|
|
|
# branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2021-05-09 14:42:59 +00:00
|
|
|
|
2021-03-25 15:05:38 +00:00
|
|
|
- name: set up JDK 1.8
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
2021-05-14 19:10:53 +00:00
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: '8'
|
2021-05-09 14:42:59 +00:00
|
|
|
|
2021-03-25 15:05:38 +00:00
|
|
|
- name: Grant execute permission for gradlew
|
|
|
|
run: chmod +x gradlew
|
2021-05-09 14:42:59 +00:00
|
|
|
|
2021-03-26 15:43:18 +00:00
|
|
|
- name: Build Github unsigned pre-release apk
|
2021-05-09 15:54:06 +00:00
|
|
|
run: ./gradlew assembleGithubRelease --stacktrace --project-prop pre --project-prop split
|
2021-05-09 14:42:59 +00:00
|
|
|
|
2021-03-26 12:20:11 +00:00
|
|
|
- name: Sign APK
|
2021-05-09 15:01:26 +00:00
|
|
|
uses: ammargitham/sign-android-release@v1.1.1
|
2021-03-26 12:20:11 +00:00
|
|
|
# ID used to access action output
|
|
|
|
id: sign_app
|
|
|
|
with:
|
2021-03-26 12:28:50 +00:00
|
|
|
releaseDirectory: app/build/outputs/apk/github/release
|
2021-03-26 12:20:11 +00:00
|
|
|
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
|
|
|
|
alias: ${{ secrets.ALIAS }}
|
|
|
|
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
|
|
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
2021-05-09 14:42:59 +00:00
|
|
|
|
2021-03-26 14:07:56 +00:00
|
|
|
- name: Get current date and time
|
|
|
|
id: date
|
|
|
|
run: echo "::set-output name=date::$(date +'%Y%m%d_%H%M%S')"
|
2021-05-09 14:42:59 +00:00
|
|
|
|
|
|
|
# Create artifact
|
2021-03-25 15:05:38 +00:00
|
|
|
- name: Create apk artifact
|
2021-03-25 16:50:47 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
2021-03-25 15:05:38 +00:00
|
|
|
with:
|
2021-03-26 15:43:18 +00:00
|
|
|
name: barinsta_pre-release_${{ steps.date.outputs.date }}
|
2021-05-09 14:42:59 +00:00
|
|
|
# path: ${{steps.sign_app.outputs.signedReleaseFile}}
|
|
|
|
path: app/build/outputs/apk/github/release/*-signed.apk
|
|
|
|
|
2021-03-26 18:14:57 +00:00
|
|
|
# Send success notification
|
|
|
|
- name: Send success Telegram notification
|
|
|
|
if: ${{ success() }}
|
2021-03-26 17:35:23 +00:00
|
|
|
uses: appleboy/telegram-action@master
|
|
|
|
with:
|
|
|
|
to: ${{ secrets.TELEGRAM_BUILDS_CHANNEL_TO }}
|
|
|
|
token: ${{ secrets.TELEGRAM_BUILDS_BOT_TOKEN }}
|
2021-03-26 18:14:57 +00:00
|
|
|
message: "${{ github.workflow }} ${{ github.job }} #${{ github.run_number }} completed successfully.\nURL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
|
2021-05-09 14:42:59 +00:00
|
|
|
# document: ${{steps.sign_app.outputs.signedReleaseFile}}
|
|
|
|
document: app/build/outputs/apk/github/release/*-signed.apk
|
|
|
|
|
2021-03-26 18:14:57 +00:00
|
|
|
# Send failure notification
|
|
|
|
- name: Send failure Telegram notification
|
|
|
|
if: ${{ failure() }}
|
|
|
|
uses: appleboy/telegram-action@master
|
|
|
|
with:
|
|
|
|
to: ${{ secrets.TELEGRAM_BUILDS_CHANNEL_TO }}
|
|
|
|
token: ${{ secrets.TELEGRAM_BUILDS_BOT_TOKEN }}
|
|
|
|
message: "${{ github.workflow }} ${{ github.job }} #${{ github.run_number }} failed.\nURL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
|