This repository was archived by the owner on May 29, 2025. It is now read-only.
opt: 继续优化锚点获取 #85
This file contains hidden or 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 for dev | |
| on: | |
| push: | |
| branches: [ dev ] | |
| paths-ignore: | |
| - "README.md" | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - 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 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 21 | |
| cache: 'gradle' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Build with Gradle | |
| run: ./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 }} | |
| COMMIT_URL: ${{ github.event.head_commit.url }} | |
| COMMIT_MESSAGE: |+ | |
| New Github CI Build from dev Branch | |
| ``` | |
| ${{ 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%20%22media%22%3A%22attach%3A%2F%2Frelease%22%7D%2C%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2Fdebug%22%2C%22parse_mode%22%3A%22MarkdownV2%22%2C%22caption%22%3A${ESCAPED}%7D%5D" -F release="@$RELEASE" -F debug="@$DEBUG" |