-
Notifications
You must be signed in to change notification settings - Fork 43
143 lines (137 loc) · 5.21 KB
/
android.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Android CI
on:
pull_request:
paths:
- 'android/**'
- '!docs/**'
push:
branches:
- 'main'
paths:
- 'android/**'
- '!docs/**'
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: 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: 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: 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: 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
if: startsWith(github.ref, 'refs/tags/android-gradle-plugin')
defaults:
run:
working-directory: 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 to gradle plugin portal
run: ./gradlew clean :measure-android-gradle:publishPlugins -Pgradle.publish.key=$gradlePluginPortalKey -Pgradle.publish.secret=$gradlePluginPortalSecret --no-daemon --no-parallel --no-configuration-cache --stacktrace
env:
gradlePluginPortalKey: ${{ secrets.GRADLE_PLUGIN_PORTAL_KEY }}
gradlePluginPortalSecret: ${{ secrets.GRADLE_PLUGIN_PORTAL_SECRET }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_ARTIFACT_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_ARTIFACT_SIGNING_PASSWORD }}
- name: Publish measure-android-gradle to maven
run: ./gradlew :measure-android-gradle:publishPluginMavenPublicationToMavenCentralRepository :measure-android-gradle:publishPluginPluginMarkerMavenPublicationToMavenCentralRepository --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 }}