Skip to content

Commit 249a01b

Browse files
committed
Enable Snapshots
1 parent 242ddea commit 249a01b

4 files changed

Lines changed: 100 additions & 41 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ jobs:
4343
passphrase: ${{ secrets.GPG_PASSPHRASE }}
4444

4545
- name: Build
46-
run: mvn -ntp -B clean verify install -DskipTests
46+
run: mvn -ntp -B clean verify install -DskipTests -Prelease
4747

4848
- name: Publish to Maven Central
4949
env:
5050
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
5151
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
52-
run: mvn -ntp -B deploy -DskipTests -Dgpg.keyname=${GPG_KEY_NAME} -Dgpg.passphrase=${GPG_PASSPHRASE}
52+
run: mvn -ntp -B deploy -DskipTests -Prelease -Dgpg.keyname=${GPG_KEY_NAME} -Dgpg.passphrase=${GPG_PASSPHRASE}

.github/workflows/snapshot.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Snapshot Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
deploy-snapshot:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
17+
- uses: actions/setup-java@v5
18+
with:
19+
distribution: 'corretto'
20+
java-version: '11'
21+
22+
- name: Grant Permission
23+
run: chmod +x ./mvnw
24+
25+
- name: Check SNAPSHOT version
26+
id: check-version
27+
run: |
28+
VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
29+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
30+
if [[ "$VERSION" == *-SNAPSHOT ]]; then
31+
echo "is_snapshot=true" >> "$GITHUB_OUTPUT"
32+
else
33+
echo "is_snapshot=false" >> "$GITHUB_OUTPUT"
34+
fi
35+
36+
- name: Remove old Maven Settings
37+
if: steps.check-version.outputs.is_snapshot == 'true'
38+
run: rm -f /home/runner/.m2/settings.xml
39+
40+
- name: Maven Settings
41+
if: steps.check-version.outputs.is_snapshot == 'true'
42+
uses: s4u/maven-settings-action@v4.0.0
43+
with:
44+
servers: |
45+
[{
46+
"id": "central",
47+
"username": "${{ secrets.OSSRH_USERNAME }}",
48+
"password": "${{ secrets.OSSRH_PASSWORD }}"
49+
}]
50+
51+
- name: Deploy Snapshot
52+
if: steps.check-version.outputs.is_snapshot == 'true'
53+
run: ./mvnw -B -ntp deploy -DskipTests

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>org.asynchttpclient</groupId>
2121
<artifactId>async-http-client-project</artifactId>
22-
<version>3.0.8</version>
22+
<version>3.0.9-SNAPSHOT</version>
2323
</parent>
2424

2525
<modelVersion>4.0.0</modelVersion>

pom.xml

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<groupId>org.asynchttpclient</groupId>
2222
<artifactId>async-http-client-project</artifactId>
23-
<version>3.0.8</version>
23+
<version>3.0.9-SNAPSHOT</version>
2424
<packaging>pom</packaging>
2525

2626
<name>AHC/Project</name>
@@ -77,12 +77,12 @@
7777

7878
<distributionManagement>
7979
<snapshotRepository>
80-
<id>sonatype-nexus-staging</id>
81-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
80+
<id>central</id>
81+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
8282
</snapshotRepository>
8383
<repository>
84-
<id>sonatype-nexus-staging</id>
85-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
84+
<id>central</id>
85+
<url>https://central.sonatype.com</url>
8686
</repository>
8787
</distributionManagement>
8888

@@ -399,39 +399,6 @@
399399
</executions>
400400
</plugin>
401401

402-
<plugin>
403-
<groupId>org.sonatype.central</groupId>
404-
<artifactId>central-publishing-maven-plugin</artifactId>
405-
<version>0.10.0</version>
406-
<extensions>true</extensions>
407-
<configuration>
408-
<publishingServerId>central</publishingServerId>
409-
</configuration>
410-
</plugin>
411-
412-
<plugin>
413-
<groupId>org.apache.maven.plugins</groupId>
414-
<artifactId>maven-gpg-plugin</artifactId>
415-
<version>3.2.8</version>
416-
<executions>
417-
<execution>
418-
<id>sign-artifacts</id>
419-
<phase>verify</phase>
420-
<goals>
421-
<goal>sign</goal>
422-
</goals>
423-
<configuration>
424-
<!-- Prevent gpg from using pinentry programs -->
425-
<gpgArguments>
426-
<arg>--pinentry-mode</arg>
427-
<arg>loopback</arg>
428-
</gpgArguments>
429-
<gpg.skip>false</gpg.skip>
430-
</configuration>
431-
</execution>
432-
</executions>
433-
</plugin>
434-
435402
<plugin>
436403
<groupId>org.revapi</groupId>
437404
<artifactId>revapi-maven-plugin</artifactId>
@@ -522,5 +489,44 @@
522489
</plugins>
523490
</build>
524491
</profile>
492+
493+
<!-- Release profile: activates central-publishing-maven-plugin and GPG signing -->
494+
<profile>
495+
<id>release</id>
496+
<build>
497+
<plugins>
498+
<plugin>
499+
<groupId>org.sonatype.central</groupId>
500+
<artifactId>central-publishing-maven-plugin</artifactId>
501+
<version>0.10.0</version>
502+
<extensions>true</extensions>
503+
<configuration>
504+
<publishingServerId>central</publishingServerId>
505+
</configuration>
506+
</plugin>
507+
<plugin>
508+
<groupId>org.apache.maven.plugins</groupId>
509+
<artifactId>maven-gpg-plugin</artifactId>
510+
<version>3.2.8</version>
511+
<executions>
512+
<execution>
513+
<id>sign-artifacts</id>
514+
<phase>verify</phase>
515+
<goals>
516+
<goal>sign</goal>
517+
</goals>
518+
<configuration>
519+
<gpgArguments>
520+
<arg>--pinentry-mode</arg>
521+
<arg>loopback</arg>
522+
</gpgArguments>
523+
<gpg.skip>false</gpg.skip>
524+
</configuration>
525+
</execution>
526+
</executions>
527+
</plugin>
528+
</plugins>
529+
</build>
530+
</profile>
525531
</profiles>
526532
</project>

0 commit comments

Comments
 (0)