File tree 2 files changed +21
-12
lines changed
2 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -2,29 +2,38 @@ name: Publish
2
2
3
3
on :
4
4
push :
5
- tags :
6
- - ' [0-9]+.[0-9]+.[0-9]+'
7
-
5
+ branches :
6
+ - main
8
7
jobs :
9
- publish :
8
+ tagpr :
9
+ permissions :
10
+ actions : write
11
+ contents : write
12
+ pull-requests : write
10
13
runs-on : ubuntu-latest
11
-
14
+ outputs :
15
+ tag : ${{ steps.run-tagpr.outputs.tag }}
12
16
steps :
13
- - uses : actions/checkout@v3
17
+ - uses : actions/checkout@v4
18
+ - uses : Songmu/tagpr@v1
19
+ env :
20
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
14
21
22
+ publish :
23
+ needs : tagpr
24
+ if : needs.tagpr.outputs.tag != '' || github.event_name == 'workflow_dispatch'
25
+ runs-on : ubuntu-latest
26
+ steps :
27
+ - uses : actions/checkout@v4
15
28
- name : Set up JDK 1.8
16
29
uses : actions/setup-java@v3
17
30
with :
18
31
distribution : temurin
19
32
java-version : 8
20
-
21
33
- name : Test
22
34
run : ./gradlew test
23
- env :
24
- OPENAI_TOKEN : ${{ secrets.OPENAI_TOKEN }}
25
-
26
35
- name : Publish
27
- run : ./gradlew build publish --no-parallel
36
+ run : ./gradlew publishAllPublicationsToMavenCentralRepository
28
37
env :
29
38
ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.SONATYPE_NEXUS_USERNAME }}
30
39
ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ allprojects {
8
8
plugins. withId(" com.vanniktech.maven.publish" ) {
9
9
mavenPublishing {
10
10
// Want to publish to so1.oss.sonatype.org
11
- publishToMavenCentral(SonatypeHost . S01 ,true )
11
+ publishToMavenCentral(SonatypeHost . S01 , true )
12
12
signAllPublications()
13
13
}
14
14
}
You can’t perform that action at this time.
0 commit comments