-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (37 loc) · 1.42 KB
/
ci.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
name: Java CI with Gradle
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 8
- name: Grant execute permission for ./gradlew
run: chmod +x gradlew
- name: Grant execute permission for codegen-test/gradlew
working-directory: ./codegen-test
run: chmod +x gradlew
- name: Assemble and Check
run: ./gradlew assemble check
- name: Test plugin (generate Java code)
working-directory: ./codegen-test
run: ./gradlew domaCodeGenJavaAll build
- name: Test plugin (generate Kotlin code)
working-directory: ./codegen-test
run: ./gradlew domaCodeGenKotlinAll build
- name: Set version
id: set-version
run: ./gradlew properties | grep "^version:" | awk '{print $2}' | { read v; echo "::set-output name=version::$v"; }
- name: Print version
run: echo ${{ steps.set-version.outputs.version }}
- name: Publish plugin
if: github.event_name == 'push' && endsWith(steps.set-version.outputs.version, 'SNAPSHOT') == false
run: ./gradlew publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}