Skip to content

Commit 5cc3d63

Browse files
acm19dblock
authored andcommitted
Automate the release fully by auto closing it
Adds the `nexus-staging-maven-plugin` to fully automate the release process by autoclosing the release from the pipeline directly. Enables contributors to merge and release code without manual action in Maven Central. Moves Javadoc and release related tasks to a profile to reduce build time when not releasing. Removes deprecated command in GitHub job `set-output`, support for it will be removed soon and the jobs using it will start to fail. Resolves: #84.
1 parent aa0f970 commit 5cc3d63

File tree

3 files changed

+45
-34
lines changed

3 files changed

+45
-34
lines changed

.github/workflows/publish-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ jobs:
2828
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2929
- name: Extract project version
3030
id: project
31-
run: echo ::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
31+
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
3232
- name: Build with Maven
33-
run: mvn -B package --file pom.xml
33+
run: mvn -B package
3434
- name: Publish to Maven central
35-
run: mvn -B deploy --file pom.xml -Pgpg-sign
35+
run: mvn -B deploy -P release -DskipTests=true
3636
env:
3737
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
3838
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
### 2.3.1 (Next)
2+
* [#107](https://github.com/acm19/aws-request-signing-apache-interceptor/pull/107): Automate the release fully by auto closing it - [@acm19](https://github.com/acm19).
23
* [#106](https://github.com/acm19/aws-request-signing-apache-interceptor/pull/106): Enforce stricter TODO comments checks - [@acm19](https://github.com/acm19).
34
* [#104](https://github.com/acm19/aws-request-signing-apache-interceptor/pull/104): Make request interceptors simpler and other improvements - [@acm19](https://github.com/acm19).
45

pom.xml

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
<id>ossrh</id>
4141
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
4242
</snapshotRepository>
43-
<repository>
44-
<id>ossrh</id>
45-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
46-
</repository>
4743
</distributionManagement>
4844

4945
<properties>
@@ -141,32 +137,6 @@
141137
<version>2.15.0</version>
142138
</plugin>
143139

144-
<plugin>
145-
<groupId>org.apache.maven.plugins</groupId>
146-
<artifactId>maven-source-plugin</artifactId>
147-
<version>3.3.0</version>
148-
<executions>
149-
<execution>
150-
<id>attach-sources</id>
151-
<goals>
152-
<goal>jar-no-fork</goal>
153-
</goals>
154-
</execution>
155-
</executions>
156-
</plugin>
157-
<plugin>
158-
<groupId>org.apache.maven.plugins</groupId>
159-
<artifactId>maven-javadoc-plugin</artifactId>
160-
<version>3.5.0</version>
161-
<executions>
162-
<execution>
163-
<id>attach-javadocs</id>
164-
<goals>
165-
<goal>jar</goal>
166-
</goals>
167-
</execution>
168-
</executions>
169-
</plugin>
170140
<plugin>
171141
<groupId>org.apache.maven.plugins</groupId>
172142
<artifactId>maven-jar-plugin</artifactId>
@@ -206,9 +176,21 @@
206176

207177
<profiles>
208178
<profile>
209-
<id>gpg-sign</id>
179+
<id>release</id>
210180
<build>
211181
<plugins>
182+
<plugin>
183+
<groupId>org.sonatype.plugins</groupId>
184+
<artifactId>nexus-staging-maven-plugin</artifactId>
185+
<version>1.6.13</version>
186+
<extensions>true</extensions>
187+
<configuration>
188+
<serverId>ossrh</serverId>
189+
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
190+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
191+
</configuration>
192+
</plugin>
193+
212194
<plugin>
213195
<groupId>org.apache.maven.plugins</groupId>
214196
<artifactId>maven-gpg-plugin</artifactId>
@@ -229,9 +211,37 @@
229211
</execution>
230212
</executions>
231213
</plugin>
214+
215+
<plugin>
216+
<groupId>org.apache.maven.plugins</groupId>
217+
<artifactId>maven-source-plugin</artifactId>
218+
<version>3.3.0</version>
219+
<executions>
220+
<execution>
221+
<id>attach-sources</id>
222+
<goals>
223+
<goal>jar-no-fork</goal>
224+
</goals>
225+
</execution>
226+
</executions>
227+
</plugin>
228+
<plugin>
229+
<groupId>org.apache.maven.plugins</groupId>
230+
<artifactId>maven-javadoc-plugin</artifactId>
231+
<version>3.5.0</version>
232+
<executions>
233+
<execution>
234+
<id>attach-javadocs</id>
235+
<goals>
236+
<goal>jar</goal>
237+
</goals>
238+
</execution>
239+
</executions>
240+
</plugin>
232241
</plugins>
233242
</build>
234243
</profile>
244+
235245
<profile>
236246
<id>checkstyle</id>
237247
<build>

0 commit comments

Comments
 (0)