-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (58 loc) · 2.19 KB
/
deploy.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
name: Deploy
on:
push:
tags:
# Gradle build logic relies on this tag format, so if you need to change it, you need to change
# it there as well.
- bom-*
env:
GPG_KEY: ${{ secrets.ANDROID_GPG_KEY }}
GPG_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.ANDROID_MAVEN_CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.ANDROID_MAVEN_CENTRAL_PASSWORD }}
jobs:
# This job's steps must be synced with prePublishCheck Gradle task's checks to ensure that
# we check required stuff on CI and at the same time developers can run the Gradle task to verify
# their changes before publishing.
preflight_check:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/basic-preflight-check
- name: Verify publishing
run: ./gradlew verifyPublishing
- name: Verify BOM version
run: ./gradlew verifyBomVersion
- name: Artifacts tests
# We need to publish the latest versions to Maven local first before we can run tests
# on published artifacts
run: |
./gradlew publishToMavenLocal \
-PsigningInMemoryKey=$GPG_KEY \
-PsigningInMemoryKeyPassword=$GPG_PASSWORD \
-PmavenCentralUsername=$MAVEN_USERNAME \
-PmavenCentralPassword=$MAVEN_PASSWORD
./gradlew :app:testDebugUnitTest
publish:
needs: preflight_check
runs-on: ubuntu-latest
permissions:
# Needed by softprops/action-gh-release to be able to create a release
contents: write
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Publish to Maven Central
run: |
./gradlew --stacktrace publishAndReleaseToMavenCentral \
-PsigningInMemoryKey=$GPG_KEY \
-PsigningInMemoryKeyPassword=$GPG_PASSWORD \
-PmavenCentralUsername=$MAVEN_USERNAME \
-PmavenCentralPassword=$MAVEN_PASSWORD
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true