-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (51 loc) · 2.02 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Java CI with Gradle
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
if: contains(github.event.head_commit.message, '[skip ci]') == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 8
- name: Grant execute permission for compile/gradlew
working-directory: ./compile
run: chmod +x gradlew
- name: Grant execute permission for compile-java-test/gradlew
working-directory: ./compile-java-test
run: chmod +x gradlew
- name: Grant execute permission for compile-kotlin-test/gradlew
working-directory: ./compile-kotlin-test
run: chmod +x gradlew
- name: Grant execute permission for compile-mix-test/gradlew
working-directory: ./compile-mix-test
run: chmod +x gradlew
- name: Build plugin
working-directory: ./compile
run: ./gradlew build
- name: Test plugin against Java
working-directory: ./compile-java-test
run: ./gradlew build
- name: Test plugin against Kotlin
working-directory: ./compile-kotlin-test
run: ./gradlew build
- name: Test plugin against a mix of Java and Kotlin
working-directory: ./compile-mix-test
run: ./gradlew build
- name: Set version
id: set-version
working-directory: ./compile
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
working-directory: ./compile
run: ./gradlew publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}