-
-
Notifications
You must be signed in to change notification settings - Fork 951
131 lines (131 loc) · 4.79 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: "Java CI"
on:
push:
branches:
- '[4-9]+.[0-9]+.x'
- '[3-9]+.[3-9]+.x'
pull_request:
branches:
- '[4-9]+.[0-9]+.x'
- '[3-9]+.[3-9]+.x'
workflow_dispatch:
jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
found_skip_publish: ${{ steps.check_prevent_property.outputs.value }}
permissions:
contents: read
steps:
- name: "📥 Checkout repository"
uses: actions/checkout@v4
- name: "🔍 Check if we should skip publish"
id: check_prevent_property
run: |
if grep -q '^preventSnapshotPublish=true' gradle.properties; then
echo "value=true" >> $GITHUB_OUTPUT
else
echo "value=false" >> $GITHUB_OUTPUT
fi
build:
needs: skip_check
permissions:
contents: read # to fetch code (actions/checkout)
strategy:
matrix:
java: [17, 21, 23]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: "📥 Checkout repository"
uses: actions/checkout@v4
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: "🔨 Build project"
id: build
env:
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
run: ./gradlew build assemble groovydoc
publish:
if: github.event_name == 'push' && needs.skip_check.outputs.found_skip_publish != 'true'
needs: build
permissions:
contents: read # limit to read access
runs-on: ubuntu-latest
steps:
- name: "📥 Checkout repository"
uses: actions/checkout@v4
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 17
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: "📤 Publish Snapshot Artifacts to Artifactory (repo.grails.org/libs-snapshot-local)"
id: publish
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
run: >
./gradlew
-Dorg.gradle.internal.publish.checksums.insecure=true
publish
docs:
if: github.event_name == 'push' && needs.skip_check.outputs.found_skip_publish != 'true'
needs: publish
runs-on: ubuntu-latest
permissions:
contents: read # limit to read access
steps:
- name: "📝 Store the target branch"
id: extract_branch
run: |
echo "Determining Target Branch"
TARGET_BRANCH=${GITHUB_REF#refs/heads/}
echo $TARGET_BRANCH
echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT
- name: "📡 Invoke the grails-doc release workflow"
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 (Use commit sha as this is a 3rd party action)
with:
workflow: Java CI
repo: grails/grails-doc
ref: ${{ steps.extract_branch.outputs.value }}
token: ${{ secrets.GH_TOKEN }}
invoke-third-party-workflows:
if: github.event_name == 'push'
needs: [build, publish]
permissions:
contents: read # limit to read access
runs-on: ubuntu-latest
steps:
- name: "📝 Store the target branch"
id: extract_branch
run: |
echo "Determining Target Branch"
TARGET_BRANCH=${GITHUB_REF#refs/heads/}
echo $TARGET_BRANCH
echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT
- name: "📝 Create Snapshot Message for the Workflow Dispatch"
id: dispatch_message
run: echo "value={\"message\":\"New Core Snapshot $(date) - $GITHUB_SHA\"}" >> $GITHUB_OUTPUT
- name: "📡 Invoke the Java CI workflow in Grails Functional Tests"
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 (Use commit sha as this is a 3rd party action)
with:
workflow: Java CI
repo: grails/grails-functional-tests
ref: ${{ steps.extract_branch.outputs.value }}
token: ${{ secrets.GH_TOKEN }}
inputs: ${{ steps.dispatch_message.outputs.value }}