I need more checks! #127
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
name: Android CI | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: ${{ !startsWith(github.event.head_commit.message, '[skip ci]') }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Setup JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Retrieve version | |
run: | | |
echo VERSION=$(echo ${{ github.event.head_commit.id }} | head -c 10) >> $GITHUB_ENV | |
- name: Write key | |
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' | |
run: | | |
if [ ! -z "${{ secrets.KEY_STORE }}" ]; then | |
echo releaseStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> gradle.properties | |
echo releaseKeyAlias='${{ secrets.ALIAS }}' >> gradle.properties | |
echo releaseKeyPassword='${{ secrets.KEY_PASSWORD }}' >> gradle.properties | |
echo releaseStoreFile='key.jks' >> gradle.properties | |
echo ${{ secrets.KEY_STORE }} | base64 --decode > key.jks | |
fi | |
- name: Build with Gradle | |
run: bash ./gradlew -PappVerName=${{ env.VERSION }} assembleRelease | |
- name: Upload built apk | |
if: success() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Zhiliao_${{ env.VERSION }} | |
path: ${{ github.workspace }}/app/build/outputs/apk/release | |
- name: Send commit to telegram | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
format: markdown | |
message: |+ | |
New push to github! | |
*${{ github.event.head_commit.message }}* by ${{ github.event.head_commit.author.name }} | |
See commit detail [here](${{ github.event.head_commit.url }}) | |
Snapshot apk is attached | |
document: ${{ github.workspace }}/app/build/outputs/apk/release/Zhiliao_${{ env.VERSION }}.apk | |
skipped: | |
runs-on: ubuntu-latest | |
if: ${{ startsWith(github.event.head_commit.message, '[skip ci]') }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Send commit to telegram | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
format: markdown | |
message: |+ | |
New push to github! | |
*${{ github.event.head_commit.message }}* by ${{ github.event.head_commit.author.name }} | |
See commit detail [here](${{ github.event.head_commit.url }}) | |
This push skipped building |