Files
lawnchair/.github/workflows/build_debug_apk.yml

89 lines
2.8 KiB
YAML

name: Build debug APK
on:
workflow_dispatch:
push:
branches:
- '*'
- '*/*'
- '**'
- '!12-dev-localization'
- '!12-alpha'
jobs:
build-debug-apk:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Check out repository
uses: actions/checkout@v2.3.4
with:
submodules: true
- name: Restore Gradle cache
uses: actions/cache@v2.1.4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Set up Java 11
uses: actions/setup-java@v1.4.3
with:
java-version: 11
- name: Grant execution permission to Gradle Wrapper
run: chmod +x gradlew
- name: Build debug APK
run: ./gradlew assembleLawnWithQuickstepDebug
- name: Sign debug APK
uses: r0adkll/sign-android-release@v1
id: sign-debug-apk
with:
releaseDirectory: build/outputs/apk/lawnWithQuickstep/debug
signingKeyBase64: ${{ secrets.KEYSTORE }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Rename artifact
run: |
oldArtifactPath="${{ steps.sign-debug-apk.outputs.signedReleaseFile }}"
newArtifactPath="${oldArtifactPath%'-signed.apk'}.apk"
echo "ARTIFACT_PATH=$newArtifactPath" >> $GITHUB_ENV
mv "$oldArtifactPath" "$newArtifactPath"
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: Debug APK
path: ${{ env.ARTIFACT_PATH }}
send-notifications:
runs-on: ubuntu-latest
needs: build-debug-apk
steps:
- name: Check out repository
uses: actions/checkout@v2.3.4
with:
submodules: true
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install gitpython requests
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: Debug APK
path: artifacts/debug-apk
- name: Send notifications
run: python send_notifications.py
env:
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
TELEGRAM_CI_BOT_TOKEN: ${{ secrets.TELEGRAM_CI_BOT_TOKEN }}
TELEGRAM_CI_CHANNEL_ID: ${{ secrets.TELEGRAM_CI_CHANNEL_ID }}
TELEGRAM_TEAM_GROUP_ID: ${{ secrets.NOTIFY_CHANNEL_ID }}
ARTIFACT_DIRECTORY: artifacts/debug-apk
GITHUB_REF: ${{ github.ref }}