File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ release :
5+ types : [published] # once a release is published in the GitHub UI
6+ workflow_dispatch : # or manually, by clicking the button
7+
8+ jobs :
9+ build :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout sources
14+ uses : actions/checkout@v4
15+
16+ - name : Set up Java with Maven cache
17+
18+ uses : actions/setup-java@v4
19+ with :
20+ java-version : ' 8'
21+ distribution : ' temurin'
22+ cache : ' maven'
23+ server-id : ossrh
24+ server-username : MAVEN_USERNAME
25+ server-password : MAVEN_PASSWORD
26+
27+ - name : Update version in Maven configuration
28+ run : |
29+ mvn --no-transfer-progress \
30+ --batch-mode \
31+ versions:set -DnewVersion=${{ github.event.release.tag_name }}
32+ if : ${{ github.event.release.tag_name }}
33+
34+ - name : Install GPG key
35+
36+ run : |
37+ cat <(echo -e "${{ secrets.OSSH_GPG_SECRET_KEY }}") | gpg --batch --import
38+ gpg --list-secret-keys --keyid-format LONG
39+
40+ - name : Publish to Maven
41+
42+ run : |
43+ mvn --no-transfer-progress \
44+ --batch-mode \
45+ -Dgpg.passphrase='${{ secrets.OSSH_GPG_SECRET_KEY_PASSWORD }}' \
46+ deploy -P sonatype-oss-release
47+
48+ env :
49+ MAVEN_USERNAME : ${{secrets.OSSH_USERNAME}}
50+ MAVEN_PASSWORD : ${{secrets.OSSH_TOKEN}}
You can’t perform that action at this time.
0 commit comments