This repository has been archived by the owner on Sep 29, 2024. It is now read-only.
Update dependency com.google.android.material:material to v1.12.0 #1149
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: | |
branches: | |
- master | |
paths-ignore: | |
- '.idea/**' | |
- '.gitattributes' | |
- '.github/**.json' | |
- '.gitignore' | |
- '.gitmodules' | |
- '**.md' | |
- 'LICENSE' | |
- 'NOTICE' | |
pull_request: | |
paths-ignore: | |
- '.idea/**' | |
- '.gitattributes' | |
- '.github/**.json' | |
- '.gitignore' | |
- '.gitmodules' | |
- '**.md' | |
- 'LICENSE' | |
- 'NOTICE' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
if: ${{ !startsWith(github.event.head_commit.message, '[skip ci]') }} | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Retrieve version | |
run: | | |
echo VERSION=$(echo ${{ github.event.head_commit.id }} | head -c 10) >> $GITHUB_ENV | |
- name: Build with Gradle | |
run: bash ./gradlew -PappVerName=${{ env.VERSION }} assembleRelease | |
- name: Sign Android release | |
if: success() && github.event_name != 'pull_request' && github.repository == 'zhaobozhen/Anywhere-' | |
id: sign | |
uses: r0adkll/sign-android-release@v1.0.4 | |
env: | |
BUILD_TOOLS_VERSION: "32.0.0" | |
with: | |
releaseDirectory: app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
- name: Upload built apk | |
if: success() && github.event_name != 'pull_request' && github.repository == 'zhaobozhen/Anywhere-' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: snapshot | |
path: ${{ steps.sign.outputs.signedReleaseFile }} | |
- name: Upload mappings | |
if: success() && github.event_name != 'pull_request' && github.ref == 'refs/heads/master' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mappings | |
path: "app/build/outputs/mapping/release" | |
- name: Get apk info | |
if: success() && github.event_name != 'pull_request' && github.repository == 'zhaobozhen/Anywhere-' | |
id: apk-info | |
uses: zhaobozhen/apk-info-action@1.1.2 | |
with: | |
apk-path: ${{ steps.sign.outputs.signedReleaseFile }} | |
- name: Upload mappings with App Center CLI | |
if: success() && github.event_name != 'pull_request' && github.repository == 'zhaobozhen/Anywhere-' | |
uses: zhaobozhen/AppCenter-Github-Action@1.0.1 | |
with: | |
command: appcenter crashes upload-mappings --mapping app/build/outputs/mapping/release/mapping.txt --version-name ${{ steps.apk-info.outputs.version-name }} --version-code ${{ steps.apk-info.outputs.version-code }} --app zhaobozhen2025-gmail.com/Anywhere | |
token: ${{secrets.APP_CENTER_TOKEN}} | |
- name: Send commit to telegram | |
if: success() && github.repository == 'zhaobozhen/Anywhere-' && github.event_name != 'pull_request' && github.ref == 'refs/heads/master' | |
env: | |
CHANNEL_ID: ${{ secrets.TELEGRAM_TO }} | |
BOT_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
FILE: ${{ github.workspace }}/${{ steps.sign.outputs.signedReleaseFile }} | |
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 }}) | |
Snapshot apk is attached | |
run: | | |
ESCAPED=`python3 -c 'import json,os,urllib.parse; print(urllib.parse.quote(json.dumps(os.environ["COMMIT_MESSAGE"])))'` | |
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22:%22document%22,%20%22media%22:%22attach://release%22,%22parse_mode%22:%22MarkdownV2%22,%22caption%22:${ESCAPED}%7D%5D" -F release="@$FILE" | |
skipped: | |
runs-on: ubuntu-latest | |
if: ${{ startsWith(github.event.head_commit.message, '[skip ci]') }} | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
- name: Send commit to telegram | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
format: markdown | |
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 }}) | |
This push skipped building |