Repository navigation
Clarify launching non-exported activities in README #33
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: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| # This creates 4 parallel jobs: dev-debug, dev-release, prod-debug, prod-release | |
| matrix: | |
| flavor: [dev, prod] | |
| buildType: [debug, release] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Generate Version Info | |
| id: vars | |
| run: | | |
| # 558 is a base version code. github.run_number increments by 1 every build. | |
| echo "version_code=$((558 + ${{ github.run_number }}))" >> $GITHUB_OUTPUT | |
| echo "short_hash=-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Build and Test with Gradle | |
| run: | | |
| # Convert 'dev' to 'Dev' and 'debug' to 'Debug' | |
| FLAVOR_CAP=$(echo ${{ matrix.flavor }} | sed 's/./\u&/') | |
| TYPE_CAP=$(echo ${{ matrix.buildType }} | sed 's/./\u&/') | |
| GRADLE_TASKS=("assemble${FLAVOR_CAP}${TYPE_CAP}") | |
| if [ "${{ matrix.buildType }}" = "debug" ]; then | |
| GRADLE_TASKS=("test${FLAVOR_CAP}${TYPE_CAP}UnitTest" "${GRADLE_TASKS[@]}") | |
| fi | |
| ./gradlew "${GRADLE_TASKS[@]}" \ | |
| -PnewVersionCode=${{ steps.vars.outputs.version_code }} \ | |
| -PversionNameSuffix=${{ steps.vars.outputs.short_hash }} | |
| - name: Sign APK | |
| uses: ilharp/sign-android-release@v2 | |
| id: sign_app | |
| with: | |
| releaseDir: app/build/outputs/apk/${{ matrix.flavor }}/${{ matrix.buildType }} | |
| signingKey: ${{ secrets.SIGNING_KEY }} | |
| keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }} | |
| keyStorePassword: ${{ secrets.SIGNING_KEY_STORE_PASSWORD }} | |
| keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} | |
| buildToolsVersion: 36.1.0 | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ActivityManager-${{ matrix.flavor }}-${{ matrix.buildType }}-${{ steps.vars.outputs.version_code }} | |
| path: ${{ steps.sign_app.outputs.signedFile }} | |
| archive: false | |
| - name: Test Summary | |
| uses: test-summary/action@v2 | |
| with: | |
| paths: "app/build/test-results/**/TEST-*.xml" | |
| if: always() |