Skip to content

Commit 9df7962

Browse files
[CS-36689] Unit Tests Added
1 parent 42d8bac commit 9df7962

File tree

2 files changed

+63
-28
lines changed

2 files changed

+63
-28
lines changed

.github/workflows/publish.yml

Lines changed: 61 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,70 @@ on:
55
branches:
66
- feat/CS-36689-compare-merge-branch
77

8-
#on:
9-
# release:
10-
# types: [ created ]
118
jobs:
12-
publish:
9+
build:
1310
runs-on: ubuntu-latest
14-
permissions:
15-
contents: read
16-
packages: write
11+
1712
steps:
18-
- uses: actions/checkout@v3
19-
- name: Set up Java for publishing to Maven Central Repository
20-
uses: actions/setup-java@v3
21-
with:
22-
java-version: '11'
23-
distribution: 'adopt'
24-
server-id: ossrh
25-
server-username: MAVEN_USERNAME
26-
server-password: MAVEN_PASSWORD
27-
- name: Publish to the Maven Central Repository
28-
run: mvn --batch-mode deploy
29-
env:
30-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
31-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
32-
- name: Set up Java for publishing to GitHub Packages
33-
uses: actions/setup-java@v3
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up JDK
17+
uses: actions/setup-java@v2
3418
with:
3519
java-version: '11'
36-
distribution: 'adopt'
37-
- name: Publish to GitHub Packages
38-
run: mvn --batch-mode deploy
20+
21+
- name: Configure settings.xml
22+
run: |
23+
mkdir -p $HOME/.m2
24+
echo "<settings><servers><server><id>deployment</id><username>\${env.DEPLOY_USERNAME}</username><password>\${env.DEPLOY_PASSWORD}</password></server></servers></settings>" > $HOME/.m2/settings.xml
25+
26+
- name: Import GPG private key
27+
run: |
28+
echo "$GPG_PRIVATE_KEY" > private.key
29+
gpg --batch --import private.key
30+
31+
- name: Maven deploy with GPG signing
32+
run: |
33+
mvn clean deploy -P release
3934
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
DEPLOY_USERNAME: ${{ secrets.OSSRH_USERNAME }}
36+
DEPLOY_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
37+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
38+
39+
40+
41+
#on:
42+
# release:
43+
# types: [ created ]
44+
#jobs:
45+
# publish:
46+
# runs-on: ubuntu-latest
47+
# permissions:
48+
# contents: read
49+
# packages: write
50+
# steps:
51+
# - uses: actions/checkout@v3
52+
# - name: Set up Java for publishing to Maven Central Repository
53+
# uses: actions/setup-java@v3
54+
# with:
55+
# java-version: '11'
56+
# distribution: 'adopt'
57+
# server-id: ossrh
58+
# server-username: MAVEN_USERNAME
59+
# server-password: MAVEN_PASSWORD
60+
#
61+
# - name: Publish to the Maven Central Repository
62+
# run: mvn --batch-mode deploy
63+
# env:
64+
# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
65+
# MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
66+
# - name: Set up Java for publishing to GitHub Packages
67+
# uses: actions/setup-java@v3
68+
# with:
69+
# java-version: '11'
70+
# distribution: 'adopt'
71+
# - name: Publish to GitHub Packages
72+
# run: mvn --batch-mode deploy
73+
# env:
74+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@
229229
</executions>
230230
</plugin>
231231

232-
233232
<plugin>
234233
<groupId>org.apache.maven.plugins</groupId>
235234
<artifactId>maven-site-plugin</artifactId>
236235
<version>${maven-site-plugin.version}</version>
237236
</plugin>
237+
238238
<plugin>
239239
<groupId>org.apache.maven.plugins</groupId>
240240
<artifactId>maven-gpg-plugin</artifactId>
@@ -249,6 +249,7 @@
249249
</execution>
250250
</executions>
251251
</plugin>
252+
252253
<plugin>
253254
<groupId>org.apache.maven.plugins</groupId>
254255
<artifactId>maven-compiler-plugin</artifactId>

0 commit comments

Comments
 (0)