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
3
3
on :
4
4
push :
5
5
branches : [ main ]
6
+ tags :
7
+ - ' v*'
6
8
pull_request :
7
9
branches : [ main ]
8
10
9
11
jobs :
10
12
build :
11
13
runs-on : ubuntu-latest
12
14
permissions :
13
- contents : read
15
+ contents : write
14
16
packages : write
15
17
steps :
16
18
- uses : actions/checkout@v4
@@ -22,10 +24,23 @@ jobs:
22
24
- name : Build
23
25
run : mvn clean verify -Dmaven.javadoc.skip=true
24
26
- 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/'))
26
28
run : mvn deploy -X -Dmaven.javadoc.skip=true -s .github/settings.xml
27
29
env :
28
30
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29
31
GITHUB_ACTOR : ${{ github.actor }}
30
32
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