-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (45 loc) · 1.56 KB
/
ci.yml
File metadata and controls
54 lines (45 loc) · 1.56 KB
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
name: Java CI with Gradle
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_call:
inputs:
ref:
description: "Git ref to check out"
required: false
type: string
publish:
description: "Publish after verification"
required: false
type: boolean
default: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ inputs.ref || github.ref }}
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: 'zulu'
java-version: 21
- name: Set up Gradle
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
- name: Build plugin
run: ./gradlew build
- name: Set version
id: set-version
run: ./gradlew properties | grep "^version:" | awk '{print $2}' | { read v; echo "version=$v" >> $GITHUB_OUTPUT; }
- name: Print version
run: echo ${{ steps.set-version.outputs.version }}
- name: Publish plugin
if: (github.event_name == 'push' || inputs.publish) && endsWith(steps.set-version.outputs.version, 'SNAPSHOT') == false
run: >
./gradlew :codegen:publishPlugins
-Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}
-Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}
-Pversion=${{ steps.set-version.outputs.version }}