Skip to content

Commit 17e573e

Browse files
committed
preparing release of version 2.0.0
1 parent 7e015db commit 17e573e

File tree

3 files changed

+176
-2
lines changed

3 files changed

+176
-2
lines changed

.github/workflows/maven.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Maven Build
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
10+
- uses: actions/checkout@v2
11+
12+
- name: Set up JDK 11
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: 11
16+
17+
- name: Build with Maven
18+
run: mvn -B install --no-transfer-progress --file pom.xml
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: release-to-maven-central
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
releaseversion:
6+
description: 'Release version'
7+
required: true
8+
default: '2.0.0'
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- run: echo "Will start a Maven Central upload with version ${{ github.event.inputs.releaseversion }}"
14+
15+
- uses: actions/checkout@v2
16+
17+
- name: Set up settings.xml for Maven Central Repository
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 11
21+
server-id: oss.sonatype.org
22+
server-username: MAVEN_USERNAME
23+
server-password: MAVEN_PASSWORD
24+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
25+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
26+
27+
- name: Set projects Maven version to GitHub Action GUI set version
28+
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress
29+
30+
- name: Publish package
31+
run: mvn --batch-mode clean deploy --no-transfer-progress -P central-deploy -DskipTests=true
32+
env:
33+
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
34+
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
35+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
36+
37+
- name: Generate changelog
38+
id: changelog
39+
uses: metcalfc/changelog-generator@v0.4.4
40+
with:
41+
myToken: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Create GitHub Release
44+
id: create_release
45+
uses: actions/create-release@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
tag_name: ${{ github.event.inputs.releaseversion }}
50+
release_name: ${{ github.event.inputs.releaseversion }}
51+
body: |
52+
Grab the new version from Maven central https://repo1.maven.org/maven2/de/codecentric/reedelk/module-xml/${{ github.event.inputs.releaseversion }}/
53+
### Things that changed in this release
54+
${{ steps.changelog.outputs.changelog }}
55+
draft: false
56+
prerelease: false

pom.xml

Lines changed: 102 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<parent>
88
<groupId>de.codecentric.reedelk</groupId>
99
<artifactId>module-parent</artifactId>
10-
<version>1.1.0</version>
10+
<version>2.0.0</version>
1111
</parent>
1212

1313
<packaging>bundle</packaging>
14-
<version>1.1.0</version>
14+
<version>2.0.0</version>
1515
<artifactId>module-xml</artifactId>
1616

1717
<properties>
@@ -22,6 +22,14 @@
2222
<mockito.version>2.23.0</mockito.version>
2323
<saxon.version>9.9.1-6</saxon.version>
2424
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
25+
26+
<!-- Maven Central Release tools -->
27+
<versions-maven-plugin.version>2.8.1</versions-maven-plugin.version>
28+
<maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
29+
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
30+
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
31+
<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
32+
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
2533
</properties>
2634

2735
<dependencies>
@@ -102,4 +110,96 @@
102110
</plugin>
103111
</plugins>
104112
</build>
113+
<profiles>
114+
<!-- plugins needed to deploy to Maven Central -->
115+
<profile>
116+
<id>central-deploy</id>
117+
<build>
118+
<plugins>
119+
<plugin>
120+
<artifactId>maven-gpg-plugin</artifactId>
121+
<version>${maven-gpg-plugin.version}</version>
122+
<executions>
123+
<execution>
124+
<id>sign-artifacts</id>
125+
<phase>verify</phase>
126+
<goals>
127+
<goal>sign</goal>
128+
</goals>
129+
<configuration>
130+
<!-- This is necessary for gpg to not try to use the pinentry programs -->
131+
<gpgArguments>
132+
<arg>--pinentry-mode</arg>
133+
<arg>loopback</arg>
134+
</gpgArguments>
135+
</configuration>
136+
</execution>
137+
</executions>
138+
</plugin>
139+
<plugin>
140+
<groupId>org.codehaus.mojo</groupId>
141+
<artifactId>versions-maven-plugin</artifactId>
142+
<version>${versions-maven-plugin.version}</version>
143+
<configuration>
144+
<generateBackupPoms>false</generateBackupPoms>
145+
</configuration>
146+
</plugin>
147+
<plugin>
148+
<artifactId>maven-deploy-plugin</artifactId>
149+
<version>${maven-deploy-plugin.version}</version>
150+
<configuration>
151+
<skip>true</skip>
152+
</configuration>
153+
</plugin>
154+
<plugin>
155+
<groupId>org.apache.maven.plugins</groupId>
156+
<artifactId>maven-source-plugin</artifactId>
157+
<version>${maven-source-plugin.version}</version>
158+
<executions>
159+
<execution>
160+
<id>attach-sources</id>
161+
<goals>
162+
<goal>jar</goal>
163+
</goals>
164+
</execution>
165+
</executions>
166+
</plugin>
167+
<plugin>
168+
<groupId>org.apache.maven.plugins</groupId>
169+
<artifactId>maven-javadoc-plugin</artifactId>
170+
<version>${maven-javadoc-plugin.version}</version>
171+
<executions>
172+
<execution>
173+
<id>attach-javadocs</id>
174+
<goals>
175+
<goal>jar</goal>
176+
</goals>
177+
</execution>
178+
</executions>
179+
</plugin>
180+
<plugin>
181+
<groupId>org.sonatype.plugins</groupId>
182+
<artifactId>nexus-staging-maven-plugin</artifactId>
183+
<version>${nexus-staging-maven-plugin.version}</version>
184+
<extensions>true</extensions>
185+
<configuration>
186+
<serverId>oss.sonatype.org</serverId>
187+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
188+
<description>${project.version}</description>
189+
</configuration>
190+
<executions>
191+
<execution>
192+
<id>deploy-to-sonatype</id>
193+
<phase>deploy</phase>
194+
<goals>
195+
<goal>deploy</goal>
196+
<goal>release</goal>
197+
</goals>
198+
</execution>
199+
</executions>
200+
</plugin>
201+
</plugins>
202+
</build>
203+
</profile>
204+
</profiles>
105205
</project>

0 commit comments

Comments
 (0)