File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+ # This workflow uses actions that are not certified by GitHub.
5+ # They are provided by a third-party and are governed by
6+ # separate terms of service, privacy policy, and support
7+ # documentation.
8+
9+ name : Maven Publish
10+
11+ on :
12+ push :
13+ branches : [ 'release' ]
14+ workflow_dispatch :
15+ inputs :
16+ revision :
17+ description : ' The version to release'
18+ required : true
19+ default : ' 0.0.1-SNAPSHOT'
20+
21+ jobs :
22+ build :
23+ runs-on : ubuntu-latest
24+ if : ${{ inputs.revision }}
25+ steps :
26+ - name : Checkout Source
27+ uses : actions/checkout@v4
28+
29+ - name : Setup Maven Central Repository
30+ uses : actions/setup-java@v4
31+ with :
32+ java-version : ' 11'
33+ distribution : ' temurin'
34+ server-id : ossrh
35+ server-username : MAVEN_USERNAME
36+ server-password : MAVEN_PASSWORD
37+ cache : maven
38+
39+ - name : Publish package
40+ run : mvn --batch-mode --update-snapshots -Drevision=${{ inputs.revision }} -Prelease clean deploy
41+ env :
42+ MAVEN_USERNAME : ${{ secrets.OSS_SONATYPE_USERNAME }}
43+ MAVEN_PASSWORD : ${{ secrets.OSS_SONATYPE_PASSWORD }}
44+ MAVEN_GPG_KEY : ${{ secrets.OSS_SIGNING_KEY }}
45+ MAVEN_GPG_PASSPHRASE : ${{ secrets.OSS_SIGNING_PASSWORD }}
You can’t perform that action at this time.
0 commit comments