[uncompleted] adj: rmv qstileblue hc hooktool #19
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: CI Build | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| paths-ignore: | |
| - ".github/**" | |
| - "!.github/workflows/**" | |
| - ".idea/" | |
| - "doc/*" | |
| - "*.md" | |
| - "imgs/*" | |
| - "app/src/assets/**" | |
| - "crowdin.yml" | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - ".github/**" | |
| - "!.github/workflows/**" | |
| - ".idea/" | |
| - "doc/*" | |
| - "*.md" | |
| - "imgs/*" | |
| - "app/src/assets/**" | |
| - ".github/workflows/crowdin.yml" | |
| - "crowdin.yml" | |
| workflow_dispatch: | |
| jobs: | |
| build_app: | |
| if: | | |
| ( | |
| startsWith(github.event.head_commit.message, 'app: update version ') | |
| || | |
| ( | |
| !contains(github.event.head_commit.message, '[release]') | |
| && !contains(github.event.head_commit.message, '[beta]') | |
| && !contains(github.event.head_commit.message, 'app: update version') | |
| ) | |
| ) | |
| runs-on: macos-latest | |
| name: Build App | |
| steps: | |
| - name: Checkout Git Repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: Setup JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| cache-overwrite-existing: true | |
| - name: Create Sign File | |
| if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' | |
| run: | | |
| touch signing.properties | |
| echo storePassword=${{ secrets.KEY_STORE_PASSWORD }} >> signing.properties | |
| echo keyAlias=${{ secrets.ALIAS }} >> signing.properties | |
| echo keyPassword='${{ secrets.KEY_STORE_PASSWORD }}' >> signing.properties | |
| echo storeFile=../key.jks >> signing.properties | |
| echo ${{ secrets.SIGNING_KEY }} | base64 --decode > key.jks | |
| echo "GIT_ACTOR=${{ secrets.GIT_ACTOR }}" >> $GITHUB_ENV | |
| echo "GIT_TOKEN=${{ secrets.GIT_TOKEN }}" >> $GITHUB_ENV | |
| - name: Build with Gradle (Canary) | |
| if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' | |
| shell: bash | |
| run: | | |
| ./gradlew assembleCanary | |
| echo "IS_DEBUG=false" >> $GITHUB_ENV | |
| - name: Build with Gradle (Debug) | |
| if: github.event_name == 'pull_request' | |
| shell: bash | |
| run: | | |
| ./gradlew assembleDebug | |
| echo "IS_DEBUG=true" >> $GITHUB_ENV | |
| - name: Find APKs | |
| run: | | |
| if [ ${{ env.IS_DEBUG }} = true ]; then | |
| APK_FILE=$(find app/build/outputs/apk/debug -name '*.apk') | |
| else | |
| APK_FILE=$(find app/build/outputs/apk/canary -name '*.apk') | |
| fi | |
| echo "APK_FILE=$APK_FILE" >> $GITHUB_ENV | |
| echo "APK_FILE_NAME=$(basename $APK_FILE .apk)" >> $GITHUB_ENV | |
| - name: Show APKs SHA256 | |
| if: success() | |
| run: | | |
| echo "### Build Success" >> $GITHUB_STEP_SUMMARY | |
| echo "|Artifact|SHA256|" >> $GITHUB_STEP_SUMMARY | |
| echo "|:---:|:---|" >> $GITHUB_STEP_SUMMARY | |
| APK_SHA256=($(shasum -a 256 ${{ env.APK_FILE }})) | |
| if [ ${{ env.IS_DEBUG }} = true ]; then | |
| echo "|Debug|$APK_SHA256" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "|Canary|$APK_SHA256" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Upload APKs | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ${{ env.APK_FILE_NAME }} | |
| path: ${{ env.APK_FILE }} | |
| compression-level: 9 | |
| push_to_canary_group: | |
| if: | | |
| github.event_name == 'push' && | |
| github.ref == 'refs/heads/main' && | |
| github.ref_type != 'tag' && | |
| !contains(github.event.head_commit.message, '[skp]') && | |
| !contains(github.event.head_commit.message, 's#') && | |
| ( | |
| startsWith(github.event.head_commit.message, 'app: update version ') | |
| || | |
| ( | |
| !contains(github.event.head_commit.message, '[release]') | |
| && !contains(github.event.head_commit.message, '[beta]') | |
| && !contains(github.event.head_commit.message, 'app: update version') | |
| ) | |
| ) | |
| runs-on: ubuntu-latest | |
| name: Push to Canary Channel | |
| needs: build_app | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| path: artifacts | |
| - name: Find Artifacts | |
| run: | | |
| echo "APK_FILE_CANARY=$(find artifacts -name '*.apk')" >> $GITHUB_ENV | |
| - name: Post to Canary Channel | |
| env: | |
| GROUP_ID: ${{ secrets.CHANNEL_ID }} | |
| BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | |
| CANARY: ${{ env.APK_FILE_CANARY }} | |
| COMMIT_MESSAGE: |+ | |
| New push to GitHub | |
| ``` | |
| ${{ github.event.head_commit.message }} | |
| ```by `${{ github.event.head_commit.author.name }}` | |
| See commit detail [here](${{ github.event.head_commit.url }}) | |
| run: | | |
| ESCAPED=$(python3 -c 'import json,os,urllib.parse; print(urllib.parse.quote(json.dumps(os.environ["COMMIT_MESSAGE"])))') | |
| cd ${{ github.workspace }} | |
| curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${GROUP_ID}&media=%5B%7B%22type%22:%22document%22,%20%22media%22:%22attach://canary%22,%22parse_mode%22:%22MarkdownV2%22,%22caption%22:${ESCAPED}%7D%5D" -F canary="@${CANARY}" | |
| push_to_debug_group: | |
| if: | | |
| github.event_name == 'pull_request' && | |
| ( | |
| startsWith(github.event.head_commit.message, 'app: update version ') | |
| || | |
| ( | |
| !contains(github.event.head_commit.message, '[release]') | |
| && !contains(github.event.head_commit.message, '[beta]') | |
| && !contains(github.event.head_commit.message, 'app: update version') | |
| ) | |
| ) | |
| runs-on: ubuntu-latest | |
| name: Push to Debug Group | |
| needs: build_app | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| path: artifacts | |
| - name: Find Artifacts | |
| run: | | |
| echo "APK_FILE_DEBUG=$(find artifacts -name '*.apk')" >> $GITHUB_ENV | |
| - name: Post to Debug Group | |
| shell: bash | |
| env: | |
| GROUP_DEBUG_ID: ${{ secrets.GROUP_DEBUG_ID }} | |
| BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | |
| DEBUG: ${{ env.APK_FILE_DEBUG }} | |
| COMMIT_MESSAGE: |+ | |
| New push to GitHub | |
| by `${{ github.triggering_actor }}` | |
| run: | | |
| ESCAPED=$(python3 -c 'import json,os,urllib.parse; print(urllib.parse.quote(json.dumps(os.environ["COMMIT_MESSAGE"])))') | |
| cd ${{ github.workspace }} | |
| curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${GROUP_DEBUG_ID}&media=%5B%7B%22type%22:%22document%22,%20%22media%22:%22attach://debug%22,%22parse_mode%22:%22MarkdownV2%22,%22caption%22:${ESCAPED}%7D%5D" -F debug="@${DEBUG}" |