-
Notifications
You must be signed in to change notification settings - Fork 80
91 lines (74 loc) · 2.4 KB
/
build.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
name: Build
on: [ push, pull_request ]
env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
PABLO_OPTS: |
-Ppablo.repository.maven.name=Sonatype \
-Ppablo.repository.maven.url=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ \
-Ppablo.repository.maven.username=${{ secrets.SONATYPE_USERNAME }} \
-Ppablo.repository.maven.password=${{ secrets.SONATYPE_PASSWORD }} \
-Ppablo.signing.keyId=${{ secrets.SIGNING_KEY_ID }} \
-Ppablo.signing.password=${{ secrets.SIGNING_PASSWORD }} \
-Ppablo.signing.secretKey='${{ secrets.SIGNING_SECRET_KEY }}'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Configure JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Publish bootstrap artifacts
run: ./gradlew publishToMavenLocal -Pbootstrap=true ${{ env.PABLO_OPTS }}
- name: Run unit tests
run: ./gradlew check
test:
name: Test
runs-on: macos-latest
strategy:
matrix:
api-level: [ 21, 29 ]
target: [ default ]
arch: [ x86_64 ]
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Publish bootstrap artifacts
run: ./gradlew publishToMavenLocal -Pbootstrap=true ${{ env.PABLO_OPTS }}
- name: Run integration tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
script: ./gradlew connectedCheck
publish:
name: Publish
runs-on: ubuntu-latest
if: contains(github.ref, '/tags/v')
needs:
- build
- test
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Upload Artifacts
run: ./gradlew publishMavenPublicationToSonatypeRepository -Pbootstrap=true ${{ env.PABLO_OPTS }}