Skip to content

feat(android): export improvements #576

feat(android): export improvements

feat(android): export improvements #576

Workflow file for this run

name: Android CI
on:
pull_request:
paths:
- 'measure-android/**'
push:
branches:
- 'main'
paths:
- 'measure-android/**'
tags:
- 'android-*'
env:
JAVA_VERSION: 17
JAVA_DISTRIBUTION: 'temurin'
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
checks:
name: Run checks
runs-on: ubuntu-latest
defaults:
run:
working-directory: measure-android
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
cache: 'gradle'
- name: Check Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Run all checks
run: ./gradlew check
# ensures benchmark app is not broken
assemble-benchmarks:
runs-on: ubuntu-latest
needs: [ checks ]
defaults:
run:
working-directory: measure-android
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Assemble benchmarks
run: ./gradlew clean :benchmarks:benchmark:assembleMeasureEnabled --no-daemon --no-parallel --no-configuration-cache --stacktrace
# ensures sample app is not broken
assemble-sample:
runs-on: ubuntu-latest
needs: [ checks ]
defaults:
run:
working-directory: measure-android
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Assemble benchmarks
# disable the upload of build to measure
run: ./gradlew clean :sample:assembleRelease --no-daemon --no-parallel --no-configuration-cache --stacktrace -x uploadReleaseBuildToMeasure
publish-android:
runs-on: ubuntu-latest
needs: [ checks ]
if: startsWith(github.ref, 'refs/tags/android-') && !startsWith(github.ref, 'refs/tags/android-gradle-plugin-')
defaults:
run:
working-directory: measure-android
permissions:
contents: read
packages: write
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Publish measure-android
run: ./gradlew clean :measure:publish --no-daemon --no-parallel --no-configuration-cache --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_ARTIFACT_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_ARTIFACT_SIGNING_PASSWORD }}
publish-android-gradle:
runs-on: ubuntu-latest
needs: [ checks ]
if: startsWith(github.ref, 'refs/tags/android-gradle-plugin')
defaults:
run:
working-directory: measure-android
permissions:
contents: read
packages: write
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Publish measure-android-gradle
run: ./gradlew clean :measure-android-gradle:publishPluginMavenPublicationToMavenCentralRepository --no-daemon --no-parallel --no-configuration-cache --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_ARTIFACT_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_ARTIFACT_SIGNING_PASSWORD }}