forked from scottyab/rootbeer
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (90 loc) · 3.32 KB
/
default.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
name: Build project
on:
pull_request:
push:
branches:
- master
- main
- trunk
- develop
- maine
- mane
schedule:
- cron: '0 3 * * 1,4'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Write Gradle build properties to `~/.gradle/gradle.properties`
run: |
mkdir -p ~/.gradle
printf "org.gradle.jvmargs=-Xmx3G -XX:+UseParallelGC\n" >> ~/.gradle/gradle.properties
printf "org.gradle.vfs.watch=false\n" >> ~/.gradle/gradle.properties
printf "org.gradle.parallel=false\n" >> ~/.gradle/gradle.properties
shell: bash
- uses: gradle/actions/setup-gradle@v3
- uses: gradle/wrapper-validation-action@v3
- run: ./gradlew projectCodestyle
- run: ./gradlew assembleRelease check --scan
- run: ./gradlew projectCoverage
- run: ./gradlew publishToMavenLocal
- run: git diff --exit-code
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: lint-results
path: '${{ github.workspace }}/**/build/**/reports/lint-results-*.html'
- name: Unwrap GPG key
if: github.repository == 'usefulness/rootbeer' && github.event_name != 'pull_request'
env:
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
run: sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'"
- name: Publish
if: github.repository == 'usefulness/rootbeer' && github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
run: ./gradlew publishReleasePublicationToGithubRepository | true
- uses: actions/cache@v4
if: github.event_name != 'pull_request'
name: Upload base (release)
with:
path: diffuse-source-file-release
key: diffuse-${{ github.sha }}-${{ hashFiles('**/aar/**.aar') }}
- run: cp rootbeer-core/build/outputs/aar/rootbeer-core-release.aar diffuse-source-file-release
if: github.event_name != 'pull_request'
shell: bash
build-sample-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Assemble sample app
uses: gradle/gradle-build-action@v3
with:
build-root-directory: sample
arguments: assemble check
- uses: actions/upload-artifact@v4
with:
name: apk
path: sample/app/build/outputs/apk/release/*.apk