修复安卓14部分版本阻止应用停止时自动清除通知遗功能异常 #19
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" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Retrieve version | |
run: echo VERSION=$(date "+%Y%m%d")-$(echo ${{ github.event.head_commit.id }} | head -c 7) >> $GITHUB_ENV | |
- name: Set version name | |
run: sed -i "s/versionName \".*\"/versionName \"${{ env.VERSION }}\"/" ${{ github.workspace }}/app/build.gradle | |
- name: Build with Gradle | |
run: ./gradlew assembleRelease | |
- name: Sign APK | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: ${{ github.workspace }}/app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNINGKEYBASE64 }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEYSTOREPASSWORD }} | |
keyPassword: ${{ secrets.KEYPASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: "30.0.2" | |
- name: Renamae | |
run: mv ${{ github.workspace }}/app/build/outputs/apk/release/app-release-unsigned-signed.apk ${{ github.workspace }}/app/build/outputs/apk/release/fcmfix-ci-${{ env.VERSION }}.apk | |
- name: Upload built apk | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release | |
path: ${{ github.workspace }}/app/build/outputs/apk/release/fcmfix-ci-${{ env.VERSION }}.apk | |
- name: Release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.TOKEN }}" | |
automatic_release_tag: ${{ env.VERSION }} | |
title: "Auto Release ${{ env.VERSION }}" | |
prerelease: false | |
files: | | |
${{ github.workspace }}/app/build/outputs/apk/release/fcmfix-ci-${{ env.VERSION }}.apk |