-
-
Notifications
You must be signed in to change notification settings - Fork 951
101 lines (101 loc) · 3.35 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
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:
build:
permissions:
contents: read # to fetch code (actions/checkout)
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11', '14']
env:
WORKSPACE: ${{ github.workspace }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Run Build
id: build
uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
with:
arguments: build groovydoc
publish:
if: github.event_name == 'push'
needs: ["build"]
permissions:
contents: read # to fetch code (actions/checkout)
checks: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
with:
distribution: 'adopt'
java-version: 11
- name: Publish Artifacts (repo.grails.org)
id: publish
uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
with:
arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish
docs:
if: github.event_name == 'push'
needs: publish
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Extract 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 grails-doc release workflow
uses: benc-uk/[email protected]
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 # to fetch code (actions/checkout)
runs-on: ubuntu-latest
steps:
- name: Extract branch name
id: extract_branch
run: echo "value=${GITHUB_REF:11}" >> $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/[email protected]
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 }}