Build-gotify-android #4
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: Build-gotify-android | |
| on: | |
| push: | |
| paths: | |
| - .github/workflows/test20.yml | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # - uses: actions/checkout@v4 | |
| - name: Delete workflow runs | |
| uses: Mattraks/delete-workflow-runs@v2 | |
| with: | |
| token: ${{ github.token }} | |
| repository: ${{ github.repository }} | |
| retain_days: 0 | |
| keep_minimum_runs: 1 | |
| - name: Checkout Source Code | |
| run: | | |
| git clone --depth 1 https://github.com/AoThen/gotify-android gotify-android_temp | |
| mv -f gotify-android_temp/* ./ | |
| rm -rf gotify-android_temp | |
| # - name: Copy CI gradle.properties | |
| # shell: bash | |
| # run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
| - name: Set up JDK | |
| uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Set up Gradle without cache | |
| uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 | |
| - name: Decode Keystore | |
| run: | | |
| echo "${{ secrets.SIGNING_KEY_BASE64 }}" | base64 -d > app/kt.jksx | |
| echo "storePassword=${{ secrets.KEY_STORE_PASSWORD }}" > keystore.properties | |
| echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> keystore.properties | |
| echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> keystore.properties | |
| echo "storeFile=kt.jksx" >> keystore.properties | |
| - name: build | |
| env: | |
| SIGN_STORE_FILE: kt.jksx | |
| SIGN_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
| SIGN_KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| SIGN_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| run: ./gradlew assembleRelease | |
| - name: Prepare App | |
| run: | | |
| find . -name "*.apk" -exec du -h {} \; | |
| mkdir -p ${{ github.workspace }}/OutAPK/ | |
| find . -name "*release*.apk" -exec mv {} ${{ github.workspace }}/OutAPK/ \; | |
| # cd packages/app-mobile/android | |
| # ./gradlew assembleRelease | |
| # cd packages/app-mobile/android/app | |
| # APK_FILE="./build/outputs/apk/release/app-release.apk" | |
| # if test ! -f "$APK_FILE" ; then | |
| # echo "APK file not found." | |
| # exit 1 | |
| # else | |
| # echo "APK file found at: $APK_FILE" | |
| # fi | |
| # for file in `find ~ \( -name "*.apk" -o -name "*java*.apk" \) -not -name "*x86*" -print`; do | |
| # base=$(basename "$file") | |
| # new_base="bitwarden_$base" | |
| # mv "$file" "OutAPK/$new_base" | |
| # done | |
| # ls OutAPK/*.apk | |
| - name: Upload App To Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gotify-android | |
| path: ${{ github.workspace }}/OutAPK/*.apk |