feat: Redesign Library Downloader Dialog UI #135
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: | |
paths: | |
- '.github/workflows/android.yml' | |
- 'app/**' | |
- 'gradle/**' | |
- 'build.gradle' | |
- 'gradle.properties' | |
- 'gradlew' | |
- 'gradlew.bat' | |
- 'public-stable-ids.txt' | |
- 'settings.gradle' | |
branches-ignore: | |
- 'wip/**' | |
workflow_dispatch: | |
jobs: | |
notifyTelegram: | |
name: Notify Telegram | |
runs-on: ${{ vars.IS_USING_HOSTED_RUNNERS == 'true' && 'self-hosted' || 'ubuntu-latest' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install Dependencies | |
run: | | |
pip install requests | |
- name: Send a message to Telegram | |
env: | |
BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
TOPIC_ID: ${{ secrets.TELEGRAM_TOPIC_ID }} | |
run: | | |
python ./.github/workflows/notify_telegram.py | |
continue-on-error: true | |
build: | |
name: Build APKs | |
runs-on: ${{ vars.IS_USING_HOSTED_RUNNERS == 'true' && 'self-hosted' || 'ubuntu-latest' }} | |
strategy: | |
matrix: | |
apiLevel: [21, 26] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Set environmental variables | |
shell: bash | |
env: | |
JSON_CONTENT: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
if: ${{ env.JSON_CONTENT != '' }} | |
run: | | |
printf 'GOOGLE_SERVICES_JSON<<EOF\n%s\nEOF\n' "$JSON_CONTENT" >> $GITHUB_ENV | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Build Release APK | |
env: | |
SKETCHUB_API_KEY: ${{ secrets.SKETCHUB_API_KEY }} | |
run: gradle assembleMinApi${{ matrix.apiLevel }}Release | |
- name: Upload Release APK | |
uses: actions/upload-artifact@v4 | |
with: | |
name: apk-minApi${{ matrix.apiLevel }}-release | |
path: app/build/outputs/apk/minApi${{ matrix.apiLevel }}/release | |
aggregateAndSend: | |
name: Send APKs to Telegram | |
runs-on: ${{ vars.IS_USING_HOSTED_RUNNERS == 'true' && 'self-hosted' || 'ubuntu-latest' }} | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Artifacts for API 21 | |
uses: actions/download-artifact@v4 | |
with: | |
name: apk-minApi21-release | |
path: ./downloaded-artifact/minApi21 | |
- name: Download Artifacts for API 26 | |
uses: actions/download-artifact@v4 | |
with: | |
name: apk-minApi26-release | |
path: ./downloaded-artifact/minApi26 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install Dependencies | |
run: | | |
pip install telethon | |
- name: Get Git Commit Info | |
run: | | |
echo "COMMIT_AUTHOR=$(git log -1 --pretty=format:'%an')" >> $GITHUB_ENV | |
echo "COMMIT_MESSAGE=$(git log -1 --pretty=format:'%s')" >> $GITHUB_ENV | |
- name: Restore Telegram session cache | |
uses: actions/cache@v4 | |
id: telegram_session_cache | |
with: | |
path: bot_session.session | |
key: telegram-session-${{ runner.os }}-bot_session | |
- name: Send APKs to Telegram | |
env: | |
API_ID: ${{ secrets.TELEGRAM_API_ID }} | |
API_HASH: ${{ secrets.TELEGRAM_API_HASH }} | |
BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
TOPIC_ID: ${{ secrets.TELEGRAM_TOPIC_ID }} | |
APK_MIN_API21: ./downloaded-artifact/minApi21/app-minApi21-release.apk | |
APK_MIN_API26: ./downloaded-artifact/minApi26/app-minApi26-release.apk | |
run: | | |
python ./.github/workflows/deploy_artifacts.py | |
continue-on-error: true | |
updateAppData: | |
name: Update App Data | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install Dependencies | |
run: | | |
pip install requests | |
- name: Run Update App Script | |
run: python .github/workflows/update_app_data.py | |
- name: Commit and Push Changes | |
env: | |
GH_ABOUT_APP_WORKFLOW_TOKEN: ${{ secrets.GH_ABOUT_APP_WORKFLOW_TOKEN }} | |
run: | | |
git checkout host | |
git config --global user.name "Sketchware Pro Actions" | |
git config --global user.email "hello@sketchware.pro" | |
git add about.json | |
git commit -m "feat: Update app about screen data" | |
git push | |
continue-on-error: true | |