-
Notifications
You must be signed in to change notification settings - Fork 1
146 lines (136 loc) · 5.35 KB
/
java-gradle-plugin.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Java Gradle plugin
# Reusable workflow for building and publishing Java Gradle plugins on the Gradle Plugin Portal
on:
workflow_call:
inputs:
java-distribution:
description: "Java distribution to be installed. (Default is microsoft)"
required: false
type: string
default: "microsoft"
java-version:
description: "Java version to be installed. (Default is 11)"
required: false
type: string
default: "11"
gradle-version:
description: "Gradle version to be installed. (Default is wrapper)"
required: false
type: string
default: "wrapper"
gradle-cache:
description: "Whether Gradle caching is enabled or not. (Default is true)"
required: false
type: boolean
default: true
working-directory:
description: "Working directory of your Gradle artifacts. (Default is .)"
required: false
type: string
default: "."
secrets:
sonar-token:
description: "Token for Sonarcloud."
required: true
sonar-organization:
description: "Organization for Sonarcloud"
required: true
signing-secret-key-ring:
description: "Key ring (base64 encoded) for signing the Sonatype publication."
required: true
signing-key-id:
description: "Key id for signing the Sonatype publication."
required: true
signing-password:
description: "Password for signing the Sonatype publication."
required: true
ossrh-username:
description: "Username for signing into Sonatype repository."
required: true
ossrh-password:
description: "Password for signing into Sonatype repository."
required: true
gradle-publish-key:
description: "Key for publishing to Gradle Plugin Portal."
required: true
gradle-publish-secret:
description: "Secret for publishing to Gradle Plugin Portal."
required: true
github-username:
description: "GitHub username for requesting changes from API."
required: true
github-token:
description: "GitHub token for requesting changes from API."
required: true
jobs:
java-gradle-base:
name: Build, Test and Assess code quality
runs-on: ubuntu-22.04
steps:
- name: Build, Test & Assess
uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@feat/split-test
# uses: bakdata/ci-templates/.github/workflows/[email protected]
with:
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
gradle-version: ${{ inputs.gradle-version }}
gradle-cache: ${{ inputs.gradle-cache }}
working-directory: ${{ inputs.working-directory }}
signing-key-id: ${{ secrets.signing-key-id }}
signing-password: ${{ secrets.signing-password }}
signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }}
sonar-organization: ${{ secrets.sonar-organization }}
sonar-token: ${{ secrets.sonar-token }}
publish:
name: Publish
runs-on: ubuntu-22.04
needs: java-gradle-base
steps:
- name: Publish
uses: bakdata/ci-templates/actions/[email protected]
with:
signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }}
signing-key-id: ${{ secrets.signing-key-id }}
signing-password: ${{ secrets.signing-password }}
ossrh-username: ${{ secrets.ossrh-username }}
ossrh-password: ${{ secrets.ossrh-password }}
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
gradle-version: ${{ inputs.gradle-version }}
gradle-cache: ${{ inputs.gradle-cache }}
working-directory: ${{ inputs.working-directory }}
publish-plugin:
name: Publish plugin
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-22.04
needs: test
steps:
- name: Publish plugin
uses: bakdata/ci-templates/actions/[email protected]
with:
signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }}
signing-key-id: ${{ secrets.signing-key-id }}
signing-password: ${{ secrets.signing-password }}
ossrh-username: ${{ secrets.ossrh-username }}
ossrh-password: ${{ secrets.ossrh-password }}
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
gradle-version: ${{ inputs.gradle-version }}
gradle-cache: ${{ inputs.gradle-cache }}
working-directory: ${{ inputs.working-directory }}
release:
name: Create Github release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-22.04
needs: publish
steps:
- name: Release on Github
uses: bakdata/ci-templates/actions/[email protected]
with:
github-username: ${{ secrets.github-username }}
github-token: ${{ secrets.github-token }}
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
gradle-version: ${{ inputs.gradle-version }}
gradle-cache: ${{ inputs.gradle-cache }}
working-directory: ${{ inputs.working-directory }}