Skip to content

Commit 5a16279

Browse files
committed
introduce tagpr
1 parent 6f6cd84 commit 5a16279

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

.github/workflows/publish.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,38 @@ name: Publish
22

33
on:
44
push:
5-
tags:
6-
- '[0-9]+.[0-9]+.[0-9]+'
7-
5+
branches:
6+
- main
87
jobs:
9-
publish:
8+
tagpr:
9+
permissions:
10+
actions: write
11+
contents: write
12+
pull-requests: write
1013
runs-on: ubuntu-latest
11-
14+
outputs:
15+
tag: ${{ steps.run-tagpr.outputs.tag }}
1216
steps:
13-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
18+
- uses: Songmu/tagpr@v1
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1421

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
1528
- name: Set up JDK 1.8
1629
uses: actions/setup-java@v3
1730
with:
1831
distribution: temurin
1932
java-version: 8
20-
2133
- name: Test
2234
run: ./gradlew test
23-
env:
24-
OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}
25-
2635
- name: Publish
27-
run: ./gradlew build publish --no-parallel
36+
run: ./gradlew publishAllPublicationsToMavenCentralRepository
2837
env:
2938
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
3039
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

0 commit comments

Comments
 (0)