844252253b034b4b4f2394cf105c980f9b94beb9 on master using build tools 34.0.0 #30
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: Android CI | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| BUILD_TOOLS_VERSION: | |
| description: Android build tools version | |
| required: true | |
| default: "34.0.0" | |
| run-name: ${{ github.sha }} on ${{ github.ref_name }} using build tools ${{ inputs.BUILD_TOOLS_VERSION }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set current date as env variable | |
| run: echo "datestamp=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
| - name: set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Debug early | |
| run: | | |
| echo "ANDROID_HOME = $ANDROID_HOME" | |
| buildTools=${ANDROID_HOME}/build-tools/${{ inputs.BUILD_TOOLS_VERSION }} | |
| echo "buildTools = $buildTools" | |
| echo "${{github.repository}}" | |
| echo ${{github.repository}} | cut -d '/' -f 2 | |
| echo "repo_name2=$(basename ${{ github.repository }})" >> $GITHUB_ENV | |
| echo "repo_name=$(echo ${{github.repository}} | cut -d '/' -f 2)" >> $GITHUB_ENV | |
| echo "repo_name = ${{env.repo_name}}" | |
| echo "repo_name2 = ${{env.repo_name2}}" | |
| echo "repo_name3 = ${{ github.event.repository.name }}" | |
| - name: Run gradle tests | |
| run: ./gradlew test | |
| - name: Build project with Gradle | |
| run: ./gradlew build | |
| # - name: Build apk debug project (APK) | |
| # run: ./gradlew assembleDebug | |
| - name: Build apk release project (APK) | |
| run: ./gradlew assemble | |
| - uses: r0adkll/sign-android-release@v1 | |
| name: Sign app APK | |
| id: sign_app | |
| with: | |
| releaseDirectory: app/build/outputs/apk/release | |
| signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
| alias: ${{ secrets.ALIAS }} | |
| keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
| env: | |
| # override default build-tools version (recommended) | |
| BUILD_TOOLS_VERSION: ${{ inputs.BUILD_TOOLS_VERSION }} | |
| - name: Sign without roadkill | |
| run: | | |
| echo "ANDROID_HOME = $ANDROID_HOME" | |
| buildTools=${ANDROID_HOME}/build-tools/${{ inputs.BUILD_TOOLS_VERSION }} | |
| echo "buildTools = $buildTools" | |
| echo ${{ secrets.SIGNING_KEY }} | base64 -di > my.jks | |
| ${buildTools}/zipalign -v -p 4 app/build/outputs/apk/release/app-release-unsigned.apk my-app-unsigned-aligned.apk | |
| ${buildTools}/apksigner sign --ks my.jks --ks-pass pass:${{ secrets.KEY_STORE_PASSWORD }} --out ${{ env.REPO_NAME }}.apk my-app-unsigned-aligned.apk | |
| echo "zip aligned and signed, now to verify signing" | |
| ${buildTools}/apksigner verify ${{ env.REPO_NAME }}.apk | |
| - name: Archive installable signed APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ github.event.repository.name }} ${{ (github.ref_name != 'master' && github.ref_name) || '' }} | |
| path: ${{steps.sign_app.outputs.signedReleaseFile}} | |
| - name: Archive installable signed APK I made | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ github.event.repository.name }} 2 ${{ (github.ref_name != 'master' && github.ref_name) || '' }} | |
| path: ${{ env.REPO_NAME }}.apk | |