File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,16 @@ name: Build and Publish
33on :
44 push :
55 branches : [ main ]
6+ tags :
7+ - ' v*'
68 pull_request :
79 branches : [ main ]
810
911jobs :
1012 build :
1113 runs-on : ubuntu-latest
1214 permissions :
13- contents : read
15+ contents : write
1416 packages : write
1517 steps :
1618 - uses : actions/checkout@v4
@@ -22,10 +24,23 @@ jobs:
2224 - name : Build
2325 run : mvn clean verify -Dmaven.javadoc.skip=true
2426 - name : Publish Package
25- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
27+ if : github.event_name == 'push' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
2628 run : mvn deploy -X -Dmaven.javadoc.skip=true -s .github/settings.xml
2729 env :
2830 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2931 GITHUB_ACTOR : ${{ github.actor }}
3032 MAVEN_USERNAME : ${{ github.actor }}
31- MAVEN_PASSWORD : ${{ secrets.GITHUB_TOKEN }}
33+ MAVEN_PASSWORD : ${{ secrets.GITHUB_TOKEN }}
34+ - name : Create Release
35+ if : startsWith(github.ref, 'refs/tags/')
36+ uses : softprops/action-gh-release@v1
37+ with :
38+ files : |
39+ target/*.jar
40+ target/*.pom
41+ target/*.asc
42+ target/*.md5
43+ target/*.sha1
44+ generate_release_notes : true
45+ env :
46+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments