Skip to content

Commit 762a3cb

Browse files
committed
Add build
1 parent 81bf519 commit 762a3cb

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,41 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v4
18+
19+
# Parses version number appropriately.
1820
- name: Parser
1921
id: parser
2022
uses: johngeorgewright/parse-version-action@v2.0.0
2123
with:
22-
ref: refs/tags/v1.0.0-test
24+
ref: refs/tags/v0.0.1-test01
2325
trim-start: v
2426

25-
- name: Debug
26-
run: echo 'version = ${{ steps.parser.outputs.version }}'
27+
# Now, build the code.
28+
- name: Set up JDK 17
29+
uses: actions/setup-java@v4
30+
with:
31+
server-id: central # Maps to central-publishing-maven-plugin config.
32+
# Maps to GitHub repository secret names.
33+
server-username: MAVEN_USERNAME
34+
server-password: MAVEN_CENTRAL_TOKEN
35+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
36+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
37+
38+
java-version: '17'
39+
distribution: 'temurin'
40+
cache: maven
41+
42+
- name: Adjust the version to the release
43+
run: mvn -B versions:set -DnewVersion=${{ steps.parser.outputs.version }} --file pom.xml
44+
env:
45+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
46+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
47+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
48+
49+
- name: Build with Maven
50+
run: mvn -B install --file pom.xml
51+
env:
52+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
53+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
54+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
2755

0 commit comments

Comments
 (0)