Skip to content

Commit e5bc9a5

Browse files
authored
[infrastructure] improve release management (#134)
- add unleash-maven-plugin - remove nexus-staging-plugin - fix signing in Jenkins environment - add script for generating release notes Signed-off-by: Jan N. Klug <[email protected]>
1 parent 737abfd commit e5bc9a5

File tree

7 files changed

+215
-87
lines changed

7 files changed

+215
-87
lines changed

examples/maven/hello/pom.xml

+12
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,16 @@
1919
</dependency>
2020
</dependencies>
2121

22+
<build>
23+
<plugins>
24+
<plugin>
25+
<groupId>org.apache.maven.plugins</groupId>
26+
<artifactId>maven-deploy-plugin</artifactId>
27+
<configuration>
28+
<skip>true</skip>
29+
</configuration>
30+
</plugin>
31+
</plugins>
32+
</build>
33+
2234
</project>

examples/maven/jdt-ecj-settings/pom.xml

+7
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@
5656
</execution>
5757
</executions>
5858
</plugin>
59+
<plugin>
60+
<groupId>org.apache.maven.plugins</groupId>
61+
<artifactId>maven-deploy-plugin</artifactId>
62+
<configuration>
63+
<skip>true</skip>
64+
</configuration>
65+
</plugin>
5966
</plugins>
6067
</build>
6168

examples/maven/lib/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010

1111
<artifactId>lib</artifactId>
1212
<name>Examples :: Lib</name>
13-
13+
1414
</project>

examples/maven/pom.xml

+7
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@
177177
</dependency>
178178
</dependencies>
179179
</plugin>
180+
<plugin>
181+
<groupId>org.apache.maven.plugins</groupId>
182+
<artifactId>maven-deploy-plugin</artifactId>
183+
<configuration>
184+
<skip>true</skip>
185+
</configuration>
186+
</plugin>
180187
</plugins>
181188
</build>
182189
</project>

libraries/pom.xml

+6-86
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,18 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44

5-
<groupId>org.lastnpe.eea</groupId>
5+
<parent>
6+
<groupId>org.lastnpe.eea</groupId>
7+
<artifactId>eea-root</artifactId>
8+
<version>2.3.0-SNAPSHOT</version>
9+
</parent>
10+
611
<artifactId>eea-parent</artifactId>
7-
<version>2.3.0-SNAPSHOT</version>
812

913
<packaging>pom</packaging>
1014

1115
<name>EEA :: Reactor</name>
1216
<description>JARs of *.eea for the JDK and common Java libraries</description>
13-
<url>https://lastnpe.org</url>
14-
<inceptionYear>2016</inceptionYear>
15-
16-
<organization>
17-
<name>LastNPE.org</name>
18-
<url>http://www.lastnpe.org</url>
19-
</organization>
20-
21-
<licenses>
22-
<license>
23-
<name>Eclipse Public License v1.0</name>
24-
<url>http://www.eclipse.org/legal/epl-v10.html</url>
25-
<distribution>repo</distribution>
26-
</license>
27-
</licenses>
28-
29-
<developers>
30-
<developer>
31-
<id>vorburger</id>
32-
<name>Michael Vorburger</name>
33-
<email>[email protected]</email>
34-
<url>http://www.vorburger.ch</url>
35-
</developer>
36-
</developers>
37-
<contributors>
38-
<contributor>
39-
<name>Please see https://github.com/lastnpe/eclipse-null-eea-augments/graphs/contributors</name>
40-
</contributor>
41-
</contributors>
4217

4318
<modules>
4419
<module>eea-all</module>
@@ -56,28 +31,6 @@
5631
<module>xstream</module>
5732
</modules>
5833

59-
<scm>
60-
<connection>https://github.com/lastnpe/eclipse-null-eea-augments.git</connection>
61-
<developerConnection>scm:git:[email protected]:lastnpe/eclipse-null-eea-augments.git</developerConnection>
62-
<tag>HEAD</tag>
63-
<url>https://github.com/lastnpe/eclipse-null-eea-augments</url>
64-
</scm>
65-
66-
<distributionManagement>
67-
<!-- http://central.sonatype.org/pages/apache-maven.html -->
68-
<snapshotRepository>
69-
<id>ossrh</id>
70-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
71-
</snapshotRepository>
72-
<!-- <repository> isn't needed with nexus-staging-maven-plugin, it somehow
73-
has this hard-coded or automatically find sit somehow, IFF <version> is non-SNAPSHOT -->
74-
</distributionManagement>
75-
76-
<properties>
77-
<eea.java.version>11</eea.java.version>
78-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
79-
</properties>
80-
8134
<build>
8235
<!-- NB: Similar configuration also in examples/maven/jdt-ecj-settings/pom.xml -->
8336
<resources>
@@ -127,20 +80,8 @@
12780
</executions>
12881
</plugin>
12982
<!-- Intentionally no maven-source-plugin & maven-javadoc-plugin; as not needed for EEA here! -->
130-
<plugin>
131-
<groupId>org.sonatype.plugins</groupId>
132-
<artifactId>nexus-staging-maven-plugin</artifactId>
133-
<version>1.6.8</version>
134-
<extensions>true</extensions>
135-
<configuration>
136-
<serverId>ossrh</serverId>
137-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
138-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
139-
</configuration>
140-
</plugin>
14183
</plugins>
14284
</build>
143-
14485
<profiles>
14586
<profile>
14687
<id>not-m2e</id>
@@ -177,27 +118,6 @@
177118
</plugins>
178119
</build>
179120
</profile>
180-
<profile>
181-
<id>release</id>
182-
<build>
183-
<plugins>
184-
<plugin>
185-
<groupId>org.apache.maven.plugins</groupId>
186-
<artifactId>maven-gpg-plugin</artifactId>
187-
<version>1.6</version>
188-
<executions>
189-
<execution>
190-
<id>sign-artifacts</id>
191-
<goals>
192-
<goal>sign</goal>
193-
</goals>
194-
<phase>verify</phase>
195-
</execution>
196-
</executions>
197-
</plugin>
198-
</plugins>
199-
</build>
200-
</profile>
201121
<profile>
202122
<id>m2e</id>
203123
<activation>

pom.xml

+93
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,103 @@
99
<packaging>pom</packaging>
1010

1111
<name>Eclipse External null Annotations (EEA)</name>
12+
<description>This is the root POM of the EEA project</description>
13+
14+
<url>https://lastnpe.org</url>
15+
<inceptionYear>2016</inceptionYear>
16+
17+
<organization>
18+
<name>LastNPE.org</name>
19+
<url>http://www.lastnpe.org</url>
20+
</organization>
21+
22+
<licenses>
23+
<license>
24+
<name>Eclipse Public License v1.0</name>
25+
<url>http://www.eclipse.org/legal/epl-v10.html</url>
26+
<distribution>repo</distribution>
27+
</license>
28+
</licenses>
29+
30+
<developers>
31+
<developer>
32+
<id>vorburger</id>
33+
<name>Michael Vorburger</name>
34+
<email>[email protected]</email>
35+
<url>http://www.vorburger.ch</url>
36+
</developer>
37+
</developers>
38+
<contributors>
39+
<contributor>
40+
<name>Please see https://github.com/lastnpe/eclipse-null-eea-augments/graphs/contributors</name>
41+
</contributor>
42+
</contributors>
43+
44+
<scm>
45+
<connection>scm:git:[email protected]:lastnpe/eclipse-null-eea-augments.git</connection>
46+
<developerConnection>scm:git:[email protected]:lastnpe/eclipse-null-eea-augments.git</developerConnection>
47+
<tag>HEAD</tag>
48+
<url>https://github.com/lastnpe/eclipse-null-eea-augments</url>
49+
</scm>
50+
51+
<distributionManagement>
52+
<repository>
53+
<id>ossrh</id>
54+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
55+
</repository>
56+
<snapshotRepository>
57+
<id>ossrh</id>
58+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
59+
</snapshotRepository>
60+
</distributionManagement>
61+
62+
<properties>
63+
<eea.java.version>11</eea.java.version>
64+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
65+
</properties>
1266

1367
<modules>
1468
<module>libraries</module>
1569
<module>examples/maven</module>
1670
</modules>
1771

72+
<profiles>
73+
<profile>
74+
<id>release</id>
75+
<build>
76+
<plugins>
77+
<plugin>
78+
<groupId>org.apache.maven.plugins</groupId>
79+
<artifactId>maven-gpg-plugin</artifactId>
80+
<version>1.6</version>
81+
<executions>
82+
<execution>
83+
<id>sign-artifacts</id>
84+
<goals>
85+
<goal>sign</goal>
86+
</goals>
87+
<phase>verify</phase>
88+
<configuration>
89+
<gpgArguments>
90+
<arg>--pinentry-mode</arg>
91+
<arg>loopback</arg>
92+
</gpgArguments>
93+
</configuration>
94+
</execution>
95+
</executions>
96+
</plugin>
97+
<plugin>
98+
<groupId>org.apache.maven.plugins</groupId>
99+
<artifactId>maven-release-plugin</artifactId>
100+
<version>3.0.0-M1</version>
101+
<configuration>
102+
<preparationGoals>clean install</preparationGoals>
103+
<tagNameFormat>v@{project.version}</tagNameFormat>
104+
</configuration>
105+
</plugin>
106+
</plugins>
107+
</build>
108+
</profile>
109+
</profiles>
110+
18111
</project>

tools/buildReleaseNotes.js

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
const http = require('https');
2+
const fs = require('fs');
3+
4+
const options = {
5+
host: 'api.github.com',
6+
path: '/repos/lastnpe/eclipse-null-eea-augments/pulls?page=1&per_page=100&state=closed',
7+
headers: {'User-Agent': 'LastNPE / 1.0.0'}
8+
};
9+
10+
const releaseTag = process.argv[2];
11+
12+
if (releaseTag == null || !releaseTag.match(/\d+\.\d+\.\d+/)) {
13+
console.error("Please provide release tag as argument in x.y.z format.");
14+
return;
15+
}
16+
17+
const request = http.request(options, function (res) {
18+
let rawData = '';
19+
res.on('data', function (chunk) {
20+
rawData += chunk;
21+
});
22+
res.on('end', function () {
23+
try {
24+
let fullJson = JSON.parse(rawData);
25+
let releasePr = [];
26+
fullJson.forEach(pr => {
27+
if (pr.merged_at != null && pr.milestone != null && pr.milestone.title === releaseTag) {
28+
let module = pr.title.match(/\[(.*)\]/)[1];
29+
if (module !== 'infrastructure') {
30+
releasePr.push({
31+
'module': module,
32+
'label': pr.labels.map(label => label.name),
33+
'title': pr.title.match(/\[.*\]\s(.*)/)[1],
34+
'issue': parseInt(pr.url.match(/\/(\d+)$/)[1]),
35+
'url': pr.url
36+
});
37+
}
38+
}
39+
});
40+
releasePr.sort(function (a, b) {
41+
// sort-order: module, issue
42+
if (a.module === b.module) {
43+
return a.issue < b.issue ? -1 : 1;
44+
} else {
45+
return a.module < b.module ? -1 : 1;
46+
}
47+
});
48+
49+
// output the table
50+
let output = '# Eclipse Null EEA Augments Release ' + releaseTag + '\n\n';
51+
output += 'This is the latest release of the external null annotations for the Eclipse null checker.\n';
52+
output += 'Please see below for a list of all changes since the last release.\n\n';
53+
output += '## Changelog\n\n';
54+
output += '| Module | Type | Issue | Description |\n'
55+
output += '|---|---|:---:|---|\n';
56+
57+
let lastModule = ''
58+
releasePr.forEach(pr => {
59+
output += '|' + (lastModule !== pr.module ? pr.module : ' ') + '|';
60+
pr.label.forEach(label => output += label + " ");
61+
output += '|[#' + pr.issue + '](' + pr.url + ')|' + pr.title + '|\n';
62+
lastModule = pr.module;
63+
});
64+
65+
// check if target directory exists (using target prevents locally generated release notes from being checked in)
66+
if (!fs.existsSync('target')) {
67+
fs.mkdir('target', (err) => {
68+
if (err) {
69+
console.error(err)
70+
}
71+
});
72+
}
73+
74+
fs.writeFile('target/releaseNotes-' + releaseTag + '.md', output, (err) => {
75+
if (err) {
76+
console.error(err);
77+
}
78+
});
79+
} catch (error) {
80+
console.error(error.message);
81+
}
82+
});
83+
});
84+
85+
request.on('error', function (e) {
86+
console.error(e.message);
87+
});
88+
89+
request.end();

0 commit comments

Comments
 (0)