1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-23 07:07:30 +00:00
BarInsta/.github/workflows/github_nightly_release.yml

71 lines
2.4 KiB
YAML
Raw Normal View History

2021-03-26 18:35:48 +00:00
name: Github nightly
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '27 10 * * *' # Everyday at 10:27:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: set up JDK 1.8
2021-05-09 16:24:40 +00:00
uses: actions/setup-java@v2
2021-03-26 18:35:48 +00:00
with:
2021-05-14 19:10:53 +00:00
distribution: 'zulu'
java-version: '8'
2021-03-26 18:35:48 +00:00
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Github unsigned apk
2021-05-09 16:11:24 +00:00
run: ./gradlew assembleGithubRelease --stacktrace --project-prop pre --project-prop split
2021-03-26 18:35:48 +00:00
- name: Sign APK
2021-05-09 16:11:24 +00:00
uses: ammargitham/sign-android-release@v1.1.1
2021-03-26 18:35:48 +00:00
# ID used to access action output
id: sign_app
with:
releaseDirectory: app/build/outputs/apk/github/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Get current date and time
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d_%H%M%S')"
# Create artifact
- name: Create apk artifact
uses: actions/upload-artifact@v2
with:
name: barinsta_nightly_${{ steps.date.outputs.date }}
2021-05-09 16:11:24 +00:00
# path: ${{steps.sign_app.outputs.signedReleaseFile}}
path: app/build/outputs/apk/github/release/*-signed.apk
2021-03-26 18:35:48 +00:00
# Send success notification
- name: Send success Telegram notification
if: ${{ success() }}
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 }} completed successfully.\nhttps://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
2021-05-09 16:11:24 +00:00
# document: ${{steps.sign_app.outputs.signedReleaseFile}}
document: app/build/outputs/apk/github/release/*-signed.apk
2021-03-26 18:35:48 +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.\nhttps://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"