-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (46 loc) · 1.6 KB
/
release.yml
File metadata and controls
58 lines (46 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Executes process associated with release.
permissions:
contents: write
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Parses version number appropriately.
- name: Parser
id: parser
uses: johngeorgewright/parse-version-action@v2.0.0
with:
ref: ${{github.ref}}
trim-start: v
# Now, build the code.
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
server-id: central # Maps to central-publishing-maven-plugin config.
# Maps to GitHub repository secret names.
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Adjust the version to the release
run: mvn -B versions:set -DnewVersion=${{ steps.parser.outputs.version }} --file pom.xml
- name: Build and deploy with Maven
run: mvn -B deploy -Ppublish --file pom.xml
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Deploy javadoc to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: java-client/target/apidocs
force_orphan: true