File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 4
4
release :
5
5
types : [created]
6
6
7
+ permissions :
8
+ contents : write
9
+
7
10
jobs :
8
11
build :
9
12
runs-on : ubuntu-latest
@@ -17,20 +20,21 @@ jobs:
17
20
java-version : ' 11'
18
21
distribution : ' temurin'
19
22
23
+ - name : Set version in pom.xml
24
+ run : |
25
+ VERSION=${GITHUB_REF#refs/tags/}
26
+ VERSION=${VERSION#v} # Remove 'v' prefix if present
27
+ mvn versions:set -DnewVersion=$VERSION
28
+
20
29
- name : Build with Maven
21
30
run : mvn clean package
22
31
23
- - name : Get artifact path
24
- id : get_artifact
25
- run : |
26
- echo "ARTIFACT_PATH=$(ls target/ShellApiLogOptimizer-*.jar | head -n 1)" >> $GITHUB_OUTPUT
27
-
28
32
- name : Upload JAR
29
33
uses : actions/upload-release-asset@v1
30
34
env :
31
35
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
32
36
with :
33
37
upload_url : ${{ github.event.release.upload_url }}
34
- asset_path : ${{ steps.get_artifact.outputs.ARTIFACT_PATH }}
38
+ asset_path : ./target/ShellApiLogOptimizer- ${{ github.ref_name }}.jar
35
39
asset_name : ShellApiLogOptimizer-${{ github.ref_name }}.jar
36
40
asset_content_type : application/java-archive
You can’t perform that action at this time.
0 commit comments