-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (77 loc) · 2.73 KB
/
gradle.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
name: Java CI
on:
push:
paths:
- '**.gradle'
- '**.properties'
- '**/src/**'
- '.github/workflows/**'
branches:
- 'master'
pull_request:
paths:
- '**.gradle'
- '**.properties'
- '**/src/**'
- '.github/workflows/**'
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install EdgeDB
uses: edgedb/setup-edgedb@8bc9e10005674ec772652b86e1fdd476e6462284
with:
server-version: 'stable'
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Gradle
run: ./gradlew build --info
release:
name: Publish artifacts
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' && ( (vars.runReleaseOnPush || 'true') == 'true' || contains(github.event.head_commit.message, '[release]') ) }}
needs: build
env:
HAS_CREDENTIALS: ${{ secrets.signingKey != '' && secrets.signingPassword != '' && secrets.sonatypeUsername != '' && secrets.sonatypePassword != '' }}
steps:
- name: Validate repository secrets for publish
if: ${{ env.HAS_CREDENTIALS != 'true' }}
run: |
echo '### Release Failed ❌' >> $GITHUB_STEP_SUMMARY
echo 'This repository does not have all required secrets: signingKey, signingPassword, sonatypeUsername or sonatypePassword).' >> $GITHUB_STEP_SUMMARY
echo "::error::This repository does not have all required secrets: signingKey, signingPassword, sonatypeUsername or sonatypePassword)."
exit -1
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Publish with Gradle
run: ./gradlew -x test publish
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.signingKey }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.signingPassword }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.sonatypeUsername }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.sonatypePassword }}