File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish to GitHub Packages
2+
3+ on :
4+ push :
5+ tags :
6+ - " v*"
7+
8+ jobs :
9+ publish :
10+ runs-on : ubuntu-latest
11+
12+ permissions :
13+ contents : read
14+ packages : write
15+
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v4
19+ with :
20+ fetch-depth : 0 # Required for flatten-maven-plugin to work with Git tags
21+
22+ - name : Set up JDK 24 and Maven
23+ uses : actions/setup-java@v4
24+ with :
25+ java-version : " 24"
26+ distribution : " temurin"
27+ cache : " maven"
28+
29+ - name : Extract version from Git tag
30+ id : version
31+ run : |
32+ VERSION=${GITHUB_REF#refs/tags/v}
33+ echo "version=$VERSION" >> $GITHUB_OUTPUT
34+ echo "Extracted version: $VERSION"
35+
36+ - name : Update version in pom.xml
37+ run : |
38+ sed -i "s/<version>.*<\/version>/<version>${{ steps.version.outputs.version }}<\/version>/" pom.xml
39+ echo "Updated pom.xml version to ${{ steps.version.outputs.version }}"
40+
41+ - name : Build and Publish
42+ env :
43+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
44+ run : |
45+ mvn clean deploy -DskipTests
You can’t perform that action at this time.
0 commit comments