File tree 1 file changed +47
-0
lines changed
1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2
+ # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3
+
4
+ name : Build and Release JAR
5
+
6
+ on :
7
+ push :
8
+ tags :
9
+ - ' v*.*.*'
10
+
11
+ jobs :
12
+ build :
13
+ runs-on : ubuntu-latest
14
+
15
+ steps :
16
+ - name : Checkout code
17
+ uses : actions/checkout@v2
18
+
19
+ - name : Set up JDK 11
20
+ uses : actions/setup-java@v2
21
+ with :
22
+ java-version : ' 11'
23
+
24
+ - name : Build with Maven
25
+ run : mvn clean package
26
+
27
+ - name : Verify JAR file exists
28
+ run : ls -l target/
29
+
30
+ - name : Create Release
31
+ id : create_release
32
+ uses : actions/create-release@v1
33
+ env :
34
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35
+ with :
36
+ tag_name : ${{ github.ref }}
37
+ release_name : Release ${{ github.ref }}
38
+ draft : false
39
+ prerelease : false
40
+
41
+ - name : Upload JAR to release
42
+ uses : actions/upload-release-asset@v1
43
+ with :
44
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
45
+ asset_path : target/*.jar
46
+ asset_name : ${{ github.ref }}.jar
47
+ asset_content_type : application/java-archive
You can’t perform that action at this time.
0 commit comments