forked from twitter/compose-rules
-
Notifications
You must be signed in to change notification settings - Fork 24
84 lines (68 loc) · 2.33 KB
/
build.yaml
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
name: Build & test
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'docs/**'
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- uses: gradle/actions/setup-gradle@v4
- name: Build
run: ./gradlew spotlessCheck assemble test
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
**/build/test-results/*
**/build/reports/*
deploy:
if: github.event_name == 'push' && github.repository == 'mrmans0n/compose-rules'
runs-on: ubuntu-latest
needs: [ build ]
timeout-minutes: 30
env:
TERM: dumb
steps:
- uses: actions/checkout@v4
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
- uses: gradle/actions/setup-gradle@v4
- name: Deploy to Sonatype
run: ./gradlew clean publish --no-parallel --no-daemon --no-configuration-cache --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }}
- name: Add artifact version to ENV
run: echo "VERSION=$(./gradlew -q printVersion)" >> $GITHUB_ENV
- name: Publish release
run: ./gradlew releaseRepository
if: success() && !endsWith(env.VERSION, '-SNAPSHOT')
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}