Root support added (Magisk & KernelSU) and Shizuku support is completely removed. #27
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: Build & Release Updater | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- name: Setup Android SDK | |
uses: android-actions/[email protected] | |
- name: Decode Keystore | |
env: | |
ENCODED_STRING: ${{ secrets.KEYSTORE_BASE_64 }} | |
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} | |
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }} | |
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | |
run: | | |
echo $ENCODED_STRING > keystore-b64.txt | |
base64 -d keystore-b64.txt > keystore.jks | |
- name: Read version from build_req.json | |
id: version | |
run: | | |
version=$(jq -r .version ./build_req.json) | |
commit_id=$(git rev-parse --short HEAD) | |
new_version="${version}-${commit_id}" | |
tag="v${version}" | |
current_version_code=$(grep "versionCode" ./app/build.gradle.kts | sed 's/[^0-9]*\([0-9]*\).*/\1/') | |
new_version_code=$((current_version_code + 1)) | |
echo "NEW_VERSION=${new_version}" >> $GITHUB_ENV | |
echo "NEW_VERSION_CODE=${new_version_code}" >> $GITHUB_ENV | |
echo "TAG=${tag}" >> $GITHUB_ENV | |
- name: Update versionName in build.gradle.kts | |
run: | | |
sed -i "s/versionName = \".*\"/versionName = \"${{ env.NEW_VERSION }}\"/" app/build.gradle.kts | |
sed -i "s/versionCode = [0-9]*/versionCode = ${NEW_VERSION_CODE}/" app/build.gradle.kts | |
- name: cat build.gradle.kts | |
run: cat app/build.gradle.kts | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build APK | |
env: | |
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} | |
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }} | |
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | |
run: ./gradlew assembleRelease --stacktrace | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./app/build/outputs/apk/release/app-release.apk | |
asset_name: app-release.apk | |
tag: ${{ env.TAG }} | |
overwrite: true | |
body: Release ${{ env.TAG}} |