-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (105 loc) · 3.65 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# This file was generated using Kotlin DSL (.github/workflows/build.main.kts).
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file.
# Generated with https://github.com/typesafegithub/github-workflows-kt
name: 'Build Gradle Release Plugin'
on:
push: {}
pull_request: {}
env:
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: 'false'
ORG_GRADLE_PROJECT_signingKey: '${{ secrets.SIGNING_KEY }}'
ORG_GRADLE_PROJECT_signingPassword: '${{ secrets.SIGNING_PASSWORD }}'
ORG_GRADLE_PROJECT_sonatypeUsername: '${{ secrets.SONATYPEUSERNAME }}'
ORG_GRADLE_PROJECT_sonatypePassword: '${{ secrets.SONATYPEPASSWORD }}'
GRADLE_PUBLISH_KEY: '${{ secrets.PLUGIN_PORTAL_KEY }}'
GRADLE_PUBLISH_SECRET: '${{ secrets.PLUGIN_PORTAL_SECRET }}'
jobs:
check_yaml_consistency:
name: 'Check YAML consistency'
runs-on: 'ubuntu-latest'
steps:
- id: 'step-0'
name: 'Check out'
uses: 'actions/checkout@v3'
- id: 'step-1'
name: 'Execute script'
run: 'rm ''.github/workflows/build.yaml'' && ''.github/workflows/build.main.kts'''
- id: 'step-2'
name: 'Consistency check'
run: 'git diff --exit-code ''.github/workflows/build.yaml'''
read-test-matrix:
name: 'Read Test Matrix'
runs-on: 'ubuntu-latest'
needs:
- 'check_yaml_consistency'
outputs:
compat: '${{ steps.step-1.outputs.compat }}'
steps:
- id: 'step-0'
name: 'Checkout'
uses: 'actions/checkout@v3'
- id: 'step-1'
run: 'echo "compat=$(jq -c . < .github/compatibility-test-matrix.json)" >> $GITHUB_OUTPUT'
compatibility-test:
name: 'Compatibility test of ${{ matrix.os }} ${{ matrix.compat }}'
runs-on: '${{ matrix.os }}'
needs:
- 'read-test-matrix'
- 'check_yaml_consistency'
strategy:
matrix:
os:
- 'ubuntu-latest'
- 'macos-latest'
- 'windows-latest'
compat: '${{ fromJSON(needs.read-test-matrix.outputs.compat) }}'
steps:
- id: 'step-0'
name: 'Checkout'
uses: 'actions/checkout@v3'
- id: 'step-1'
name: 'Set up JDK'
uses: 'actions/setup-java@v3'
with:
java-version: '17'
distribution: 'temurin'
check-latest: 'true'
- id: 'step-2'
name: 'Compatibility Test os=${{ matrix.os }} java-version=${{ matrix.compat.javaVersion }} gradle-version=${{ matrix.compat.gradleVersion }}'
uses: 'gradle/gradle-build-action@v2'
with:
gradle-version: 'wrapper'
gradle-home-cache-includes: |-
jdks
caches
notifications
arguments: 'build compatibilityTest -Pcompatibility-test.java-version=${{ matrix.compat.javaVersion }} -Pcompatibility-test.gradle-version=${{ matrix.compat.gradleVersion }} --info --scan --stacktrace'
gradle-home-cache-cleanup: 'true'
release:
runs-on: 'ubuntu-latest'
needs:
- 'compatibility-test'
- 'check_yaml_consistency'
if: 'startsWith(github.event.ref, ''refs/tags/v'')'
steps:
- id: 'step-0'
name: 'Checkout'
uses: 'actions/checkout@v3'
- id: 'step-1'
name: 'Set up JDK'
uses: 'actions/setup-java@v3'
with:
java-version: '17'
distribution: 'temurin'
check-latest: 'true'
- id: 'step-2'
name: 'Release'
uses: 'gradle/gradle-build-action@v2'
with:
gradle-version: 'wrapper'
gradle-home-cache-includes: |-
jdks
caches
notifications
arguments: 'build publishPlugins -Pgradle.publish.key=$GRADLE_PUBLISH_KEY -Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET --info --scan --stacktrace --no-configuration-cache'
gradle-home-cache-cleanup: 'true'