fix: Remove themeMode method. (#527) #833
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 Dev | |
on: | |
push: | |
branches: [Dev, new] | |
paths-ignore: | |
- "README.md" | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Write key | |
if: ${{ github.event_name != 'pull_request' || github.ref_type == 'tag' }} | |
run: | | |
if [ ! -z "${{ secrets.SIGNING_KEY }}" ]; then | |
echo androidStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> local.properties | |
echo androidKeyAlias='xiao_wine' >> local.properties | |
echo androidKeyPassword='${{ secrets.KEY_STORE_PASSWORD }}' >> local.properties | |
echo androidStoreFile=`pwd`/key.jks >> local.properties | |
echo ${{ secrets.SIGNING_KEY }} | base64 --decode > key.jks | |
fi | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 21 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
cache-read-only: ${{ github.ref != 'refs/heads/dev' && github.ref != 'refs/heads/new' }} | |
- name: Build with Gradle | |
run: | | |
echo 'org.gradle.parallel=true' >> gradle.properties | |
echo 'org.gradle.jvmargs=-Xmx4g' >> gradle.properties | |
./gradlew assemble | |
- name: Upload Release APK | |
uses: actions/upload-artifact@v4 | |
with: | |
name: StatusBarLyric_release | |
path: ./app/build/outputs/apk/release | |
- name: Upload Debug APK | |
uses: actions/upload-artifact@v4 | |
with: | |
name: StatusBarLyric_debug | |
path: ./app/build/outputs/apk/debug | |
- name: Upload Release Mapping | |
uses: actions/upload-artifact@v4 | |
with: | |
name: StatusBarLyric_release_mapping | |
path: ./app/build/outputs/mapping/release/mapping.txt | |
- name: Post to channel | |
if: contains(github.event.head_commit.message, '[skip post]') == false && github.event_name != 'pull_request' | |
env: | |
CHANNEL_ID: ${{ secrets.CHANNEL_DEV_ID }} | |
BOT_TOKEN: ${{ secrets.BOT_DEV_TOKEN }} | |
MAPPING: ./app/build/outputs/mapping/release/mapping.txt | |
COMMIT_URL: ${{ github.event.head_commit.url }} | |
COMMIT_MESSAGE: |+ | |
Github CI Build | |
``` | |
${{ github.event.head_commit.message }} | |
``` | |
run: | | |
export RELEASE=$(find ./app/build/outputs/apk/release -name "*.apk") | |
export DEBUG=$(find ./app/build/outputs/apk/debug -name "*.apk") | |
ESCAPED=`python3 -c 'import json,os,urllib.parse; msg = json.dumps(os.environ["COMMIT_MESSAGE"]); print(urllib.parse.quote(msg if len(msg) <= 1024 else json.dumps(os.environ["COMMIT_URL"])))'` | |
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22%3A%22document%22%2C%22media%22%3A%22attach%3A%2F%2Frelease%22%7D%2C%7B%22type%22%3A%22document%22%2C%22media%22%3A%22attach%3A%2F%2Fdebug%22%7D%2C%7B%22type%22%3A%22document%22%2C%22media%22%3A%22attach%3A%2F%2Fmapping%22%2C%22parse_mode%22%3A%22MarkdownV2%22%2C%22caption%22%3A${ESCAPED}%7D%5D" -F release="@$RELEASE" -F debug="@$DEBUG" -F mapping="@$MAPPING" |