1- name : Nebula Build
1+ name : Nebula Publish
22on :
33 push :
4- branches :
5- - ' main'
64 tags :
75 - v*.*.*
86 - v*.*.*-rc.*
9- pull_request :
107
118jobs :
12- buildmultijdk :
13- if : (!startsWith(github.ref, 'refs/tags/v'))
14- runs-on : ubuntu-latest
15- strategy :
16- matrix :
17- # test against latest update of some major Java version(s), as well as specific LTS version(s)
18- java : [17, 21]
19- name : Gradle Build without Publish
20- steps :
21- - uses : actions/checkout@v4
22- - name : Setup git user
23- run : |
24- git config --global user.name "Nebula Plugin Maintainers"
25- git config --global user.email "nebula-plugins-oss@netflix.com"
26- - name : Set up JDKs
27- uses : actions/setup-java@v4
28- with :
29- distribution : ' zulu'
30- java-version : |
31- 17
32- ${{ matrix.java }}
33- java-package : jdk
34- - name : Setup Gradle
35- uses : gradle/actions/setup-gradle@v5
36- with :
37- cache-overwrite-existing : true
38- - name : Gradle build
39- run : ./gradlew --stacktrace build
40- env :
41- JDK_VERSION_FOR_TESTS : ${{ matrix.java }}
429 validatepluginpublication :
43- if : startsWith(github.ref, 'refs/tags/v')
4410 runs-on : ubuntu-latest
4511 name : Gradle Plugin Publication Validation
4612 env :
@@ -65,12 +31,10 @@ jobs:
6531 with :
6632 cache-overwrite-existing : true
6733 - name : Verify plugin publication
68- if : |
69- startsWith(github.ref, 'refs/tags/v') &&
70- (!contains(github.ref, '-rc.'))
71- run : ./gradlew --stacktrace -Dgradle.publish.key=${{ secrets.gradlePublishKey }} -Dgradle.publish.secret=${{ secrets.gradlePublishSecret }} -Prelease.useLastTag=true final publishPlugin --validate-only -x check -x signPluginMavenPublication
34+ if : (!contains(github.ref, '-rc.'))
35+ run : ./gradlew --stacktrace -Dgradle.publish.key=${{ secrets.gradlePublishKey }} -Dgradle.publish.secret=${{ secrets.gradlePublishSecret }} -Prelease.useLastTag=true final publishPlugin --validate-only -x check
7236 publish :
73- if : startsWith( github.ref, 'refs/tags/v')
37+ if : github.event.base_ref == 'refs/heads/main' # tags must be pushed to main
7438 needs : validatepluginpublication
7539 runs-on : ubuntu-latest
7640 name : Gradle Build and Publish
@@ -99,13 +63,11 @@ jobs:
9963 uses : gradle/actions/setup-gradle@v5
10064 with :
10165 cache-overwrite-existing : true
66+ - name : Gradle build
67+ run : ./gradlew --stacktrace build
10268 - name : Publish candidate
103- if : |
104- startsWith(github.ref, 'refs/tags/v') &&
105- contains(github.ref, '-rc.')
69+ if : contains(github.ref, '-rc.')
10670 run : ./gradlew --stacktrace -Prelease.useLastTag=true candidate
10771 - name : Publish release
108- if : |
109- startsWith(github.ref, 'refs/tags/v') &&
110- (!contains(github.ref, '-rc.'))
111- run : ./gradlew --stacktrace -Dgradle.publish.key=${{ secrets.gradlePublishKey }} -Dgradle.publish.secret=${{ secrets.gradlePublishSecret }} -Prelease.useLastTag=true final
72+ if : (!contains(github.ref, '-rc.'))
73+ run : ./gradlew --stacktrace -Dgradle.publish.key=${{ secrets.gradlePublishKey }} -Dgradle.publish.secret=${{ secrets.gradlePublishSecret }} -Prelease.useLastTag=true final
0 commit comments