Build release APK #40
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
# TODO: Add signing key and build app bundle | |
name: Build release APK | |
on: | |
workflow_dispatch: | |
jobs: | |
build-release-apk: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 21 | |
- uses: gradle/actions/setup-gradle@v4 | |
with: | |
cache-encryption-key: Da25KUVSE5jbGds2zXmfXw== | |
- name: Write sign info | |
if: github.repository_owner == 'LawnchairLauncher' | |
run: | | |
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then | |
echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' >> keystore.properties | |
echo keyAlias='${{ secrets.KEY_ALIAS }}' >> keystore.properties | |
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> keystore.properties | |
echo storeFile='${{ github.workspace }}/key.jks' >> keystore.properties | |
echo ${{ secrets.KEYSTORE }} | base64 --decode > ${{ github.workspace }}/key.jks | |
fi | |
- name: Build release APK | |
run: ./gradlew app:assembleRelease | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Release APK | |
path: app/build/outputs/apk/app/release/*.apk | |
send-notifications: | |
runs-on: ubuntu-latest | |
needs: build-release-apk | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
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@v4 | |
with: | |
name: Release APK | |
path: artifacts/release-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.TELEGRAM_TEAM_GROUP_ID }} | |
ARTIFACT_DIRECTORY: artifacts/release-apk | |
GITHUB_REF: ${{ github.ref }} |