Files
lawnchair/.github/workflows/build_release_apk.yml
2022-08-10 15:07:14 +05:30

74 lines
2.4 KiB
YAML

name: Build release APK
on:
workflow_dispatch:
push:
branches:
- 12.1-alpha
jobs:
build-release-apk:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Java 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- uses: gradle/gradle-build-action@v2
- name: Write sign info
if: github.repository == 'LawnchairLauncher/lawnchair'
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 assembleLawnWithQuickstepRelease
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Release APK
path: build/outputs/apk/lawnWithQuickstep/release/*.apk
send-notifications:
runs-on: ubuntu-latest
if: github.repository == 'LawnchairLauncher/lawnchair'
needs: build-release-apk
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
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@v3
with:
name: Release APK
path: artifacts/release-apk
- name: Send notifications
run: python ci.py
env:
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
TELEGRAM_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/release-apk
GITHUB_REF: ${{ github.ref }}
ACTION: internal_notifications