Skip to content

Commit 73f741b

Browse files
committed
build: remove use of setup-maven plugin
Locking maven version is better done with mvnw but probably not necessary here, better to just use what is available on GHA runner for now, to rely on `setup-java` to configure for us. Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
1 parent 784dcde commit 73f741b

3 files changed

Lines changed: 16 additions & 40 deletions

File tree

.github/workflows/release_on_pr.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ jobs:
77
if: github.event.deployment.environment == 'production'
88
runs-on: ubuntu-latest
99
env:
10-
MAVEN_GPG_SIGN_KEY: '${{ secrets.MAVEN_GPG_SIGN_KEY }}'
11-
username: '${{ secrets.maven_deploy_username }}'
12-
password: '${{ secrets.maven_deploy_password }}'
13-
passphrase: '${{ secrets.gpg_passphrase }}'
1410
GITHUB_TOKEN: '${{ secrets.GAUGEBOT_GITHUB_TOKEN }}'
1511
CI: true
1612

@@ -21,19 +17,11 @@ jobs:
2117
with:
2218
distribution: 'temurin'
2319
java-version: '21'
24-
25-
- name: Set up Maven
26-
uses: stCarolas/setup-maven@v5
27-
with:
28-
maven-version: 3.9.9
29-
30-
- name: Setup maven
31-
run: |
32-
echo -e "$MAVEN_GPG_SIGN_KEY" | gpg --import --batch -
33-
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys $gpgkey
34-
rm -rf $HOME/.m2
35-
mkdir -p $HOME/.m2
36-
echo -e "<settings>\n<servers>\n<server>\n<id>central</id>\n<username>$username</username>\n<password>$password</password>\n</server>\n</servers>\n</settings>" > $HOME/.m2/settings.xml
20+
cache: maven
21+
server-id: central
22+
server-username: MAVEN_CENTRAL_USERNAME
23+
server-password: MAVEN_CENTRAL_PASSWORD
24+
gpg-private-key: ${{ secrets.MAVEN_GPG_SIGN_KEY }}
3725

3826
- name: Setup git
3927
run: |
@@ -67,8 +55,11 @@ jobs:
6755
6856
- name: Deploy on maven central
6957
run: |
70-
mvn -q clean deploy -Dgpg.passphrase=$passphrase
71-
58+
mvn -B "-Dstyle.color=always" clean deploy
59+
env:
60+
MAVEN_CENTRAL_USERNAME: ${{ secrets.maven_deploy_username }}
61+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.maven_deploy_password }}
62+
MAVEN_GPG_PASSPHRASE: ${{ secrets.gpg_passphrase }}
7263

7364
- name: Update metadata in gauge-repository
7465
run: |

.github/workflows/tests.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@ jobs:
2525
with:
2626
distribution: 'temurin'
2727
java-version: ${{ matrix.java_version }}
28-
29-
- name: Set up Maven
30-
uses: stCarolas/setup-maven@v5
31-
with:
32-
maven-version: 3.9.9
28+
cache: maven
3329

3430
- name: Run test
35-
run: mvn -q clean test
31+
run: mvn -B "-Dstyle.color=always" clean test
3632

3733
functional_tests:
3834
name: FTs - java ${{ matrix.java_version }} ${{ matrix.os }}
@@ -58,11 +54,7 @@ jobs:
5854
with:
5955
distribution: 'temurin'
6056
java-version: ${{ matrix.java_version }}
61-
62-
- name: Set up Maven
63-
uses: stCarolas/setup-maven@v5
64-
with:
65-
maven-version: 3.9.9
57+
cache: maven
6658

6759
- uses: getgauge/setup-gauge@master
6860
with:
@@ -75,7 +67,7 @@ jobs:
7567
7668
- name: Install Gauge Java maven package locally
7769
run: |
78-
mvn -q install -DskipTests -"Dgpg.skip" -D"maven.javadoc.skip=true"
70+
mvn -B "-Dstyle.color=always" -DskipTests "-Dgpg.skip" "-Dmaven.javadoc.skip=true" install
7971
8072
- name: Clone gauge-tests
8173
run: |
@@ -122,11 +114,7 @@ jobs:
122114
with:
123115
distribution: 'temurin'
124116
java-version: ${{ matrix.java_version }}
125-
126-
- name: Set up Maven
127-
uses: stCarolas/setup-maven@v5
128-
with:
129-
maven-version: 3.9.9
117+
cache: maven
130118

131119
- uses: getgauge/setup-gauge@master
132120
with:

pom.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,7 @@
256256
<goal>sign</goal>
257257
</goals>
258258
<configuration>
259-
<gpgArguments>
260-
<arg>--pinentry-mode</arg>
261-
<arg>loopback</arg>
262-
</gpgArguments>
259+
<bestPractices>true</bestPractices>
263260
</configuration>
264261
</execution>
265262
</executions>

0 commit comments

Comments
 (0)