Skip to content

Commit 9c9cd1a

Browse files
committedApr 16, 2021
Update deployment scripts for Maven Central release
1 parent 39a1b9a commit 9c9cd1a

File tree

26 files changed

+300
-103
lines changed

26 files changed

+300
-103
lines changed
 

‎.github/workflows/java8-maven.yml

+52-16
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,12 @@ jobs:
88
fail-fast: false
99
matrix:
1010
java: [ 8, 11 ]
11-
os: [ ubuntu-latest, windows-latest ]
11+
os: [ ubuntu-latest, macOS-latest, windows-latest ]
1212
experimental: [ false ]
1313
include:
1414
- java: '>11'
1515
os: ubuntu-latest
1616
experimental: true
17-
- java: '8'
18-
os: macOS-latest
19-
experimental: true
20-
- java: '11'
21-
os: macOS-latest
22-
experimental: true
2317

2418
name: JDK${{ matrix.java }} on ${{ matrix.os }}
2519
runs-on: ${{ matrix.os }}
@@ -46,7 +40,44 @@ jobs:
4640
- name: Build and (headless) test with Maven
4741
uses: GabrielBB/xvfb-action@v1
4842
with:
49-
run: mvn -B package --file pom.xml
43+
run: mvn -B -ntp package
44+
45+
snapshot-job:
46+
needs: build-and-test-job
47+
if: startsWith(github.repository, 'jdemetra/') && startsWith(github.ref, 'refs/heads/develop')
48+
strategy:
49+
matrix:
50+
java: [ 11 ]
51+
os: [ ubuntu-latest ]
52+
53+
name: Snapshot on develop
54+
runs-on: ${{ matrix.os }}
55+
56+
steps:
57+
- name: Checkout source code
58+
uses: actions/checkout@v2
59+
with:
60+
submodules: true
61+
62+
- name: Setup Java
63+
uses: actions/setup-java@v1
64+
with:
65+
java-version: ${{ matrix.java }}
66+
67+
- name: Setup Maven cache
68+
uses: actions/cache@v1
69+
with:
70+
path: ~/.m2
71+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
72+
restore-keys: ${{ runner.os }}-m2
73+
74+
- name: Deploy snapshot with Maven if settings defined
75+
run: (test -f ci.settings.xml && mvn -B -ntp deploy -DskipTests=true -s ci.settings.xml -P base-deploy,snapshot-deploy,!non-deployable-modules) || echo "No Maven deployment"
76+
env:
77+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
78+
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
79+
SIGN_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
80+
SIGN_KEY_PASS: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
5081

5182
release-job:
5283
needs: build-and-test-job
@@ -77,8 +108,19 @@ jobs:
77108
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
78109
restore-keys: ${{ runner.os }}-m2
79110

80-
- name: Build with Maven
81-
run: mvn -B package --file pom.xml -DskipTests=true
111+
- name: Deploy with Maven if settings defined
112+
run: (test -f ci.settings.xml && mvn -B -ntp deploy -DskipTests=true -s ci.settings.xml -P base-deploy,release-deploy,!non-deployable-modules) || echo "No Maven deployment"
113+
env:
114+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
115+
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
116+
SIGN_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
117+
SIGN_KEY_PASS: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
118+
119+
- name: Build assets with Maven
120+
run: mvn -B -ntp install -DskipTests=true -P base-deploy
121+
env:
122+
SIGN_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
123+
SIGN_KEY_PASS: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
82124

83125
- name: Create dummy file if no assets
84126
run: test -d "binaries" || (mkdir binaries && echo "no assets" > binaries/no_assets.txt)
@@ -89,9 +131,3 @@ jobs:
89131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90132
with:
91133
file: 'binaries/*'
92-
93-
- name: Deploy with Maven
94-
run: test -f ci.settings.xml && mvn -B deploy -Dmaven.test.skip -s ci.settings.xml -P deploy-releases
95-
env:
96-
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
97-
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}

‎.gitignore

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
/jtstoolkit/target/
2-
/jtss/target/
3-
/utilities/target/
4-
/jdbcprovider/target/
5-
/odbcprovider/target/
6-
/spreadsheetprovider/target/
7-
/sdmxprovider/target/
8-
/commonprovider/target/
9-
/jbench/target/
10-
/jwsacruncher/target/
11-
/spreadsheet/*/target/
12-
/demetra-tck/target/
13-
/demetra-workspace/target/
1+
target/
142
/jtss/nbproject/
153
/binaries/

‎ci.settings.xml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
23
<servers>
34
<server>
4-
<id>oss-jfrog-artifactory</id>
5-
<username>${env.CI_DEPLOY_USERNAME}</username>
6-
<password>${env.CI_DEPLOY_PASSWORD}</password>
5+
<id>ossrh</id>
6+
<username>${env.OSSRH_USERNAME}</username>
7+
<password>${env.OSSRH_TOKEN}</password>
78
</server>
89
</servers>
910
</settings>

‎commonprovider/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
<name>Demetra - Common</name>
1515
<description>A TS Provider that handles several sources such as csv files.</description>
16+
<url>https://github.com/jdemetra/jdemetra-core</url>
1617

1718
<properties>
1819
<opencsv.version>2.3</opencsv.version>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Workaround for JavaDoc issues with Lombok.
3+
*/
4+
public class EmptyJavaDoc {
5+
6+
}

‎demetra-tck/pom.xml

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<packaging>jar</packaging>
1313

1414
<name>Demetra - TCK</name>
15+
<description>Seasonal Adjustment Toolkit - TCK</description>
16+
<url>https://github.com/jdemetra/jdemetra-core</url>
1517

1618
<dependencies>
1719
<!-- compile only -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Workaround for JavaDoc issues with Lombok.
3+
*/
4+
public class EmptyJavaDoc {
5+
6+
}

‎demetra-workspace/pom.xml

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
</parent>
1010

1111
<artifactId>demetra-workspace</artifactId>
12+
<packaging>jar</packaging>
13+
1214
<name>Demetra - Workspace</name>
13-
15+
<description>Seasonal Adjustment Toolkit - Workspace</description>
16+
<url>https://github.com/jdemetra/jdemetra-core</url>
17+
1418
<properties>
1519
<jimfs.version>1.2</jimfs.version>
1620
</properties>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Workaround for JavaDoc issues with Lombok.
3+
*/
4+
public class EmptyJavaDoc {
5+
6+
}

‎jbench/pom.xml

+4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
</parent>
1111

1212
<artifactId>jbench</artifactId>
13+
<packaging>jar</packaging>
14+
1315
<name>jbench</name>
16+
<description>Seasonal Adjustment Toolkit - jbench</description>
17+
<url>https://github.com/jdemetra/jdemetra-core</url>
1418

1519
<dependencies>
1620
<!-- compile and runtime -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Workaround for JavaDoc issues with Lombok.
3+
*/
4+
public class EmptyJavaDoc {
5+
6+
}

‎jdbcprovider/pom.xml

+2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
</parent>
1010

1111
<artifactId>demetra-jdbc</artifactId>
12+
<packaging>jar</packaging>
1213

1314
<name>Demetra - JDBC</name>
1415
<description>A TS Provider that handles JDBC sources such as Oracle and MySql.</description>
16+
<url>https://github.com/jdemetra/jdemetra-core</url>
1517

1618
<properties>
1719
<hsqldb.version>2.5.1</hsqldb.version>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Workaround for JavaDoc issues with Lombok.
3+
*/
4+
public class EmptyJavaDoc {
5+
6+
}

‎jtss/pom.xml

+2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
</parent>
1010

1111
<artifactId>demetra-tss</artifactId>
12+
<packaging>jar</packaging>
1213

1314
<name>jtss</name>
15+
<url>https://github.com/jdemetra/jdemetra-core</url>
1416

1517
<dependencies>
1618
<!-- compile only -->
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Workaround for JavaDoc issues with Lombok.
3+
*/
4+
public class EmptyJavaDoc {
5+
6+
}

‎jtstoolkit/pom.xml

+49-9
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
</parent>
1010

1111
<artifactId>demetra-tstoolkit</artifactId>
12-
12+
<packaging>jar</packaging>
13+
1314
<name>jtstoolkit</name>
15+
<description>Seasonal Adjustment Toolkit - jtstoolkit</description>
16+
<url>https://github.com/jdemetra/jdemetra-core</url>
1417

1518
<properties>
1619
<project.x.binaries>${project.basedir}/../binaries</project.x.binaries>
@@ -32,24 +35,61 @@
3235

3336
<build>
3437
<plugins>
38+
<!-- Copies files to binaries -->
3539
<plugin>
3640
<groupId>org.apache.maven.plugins</groupId>
37-
<artifactId>maven-antrun-plugin</artifactId>
38-
<version>3.0.0</version>
41+
<artifactId>maven-resources-plugin</artifactId>
42+
<version>3.2.0</version>
3943
<executions>
4044
<execution>
41-
<phase>package</phase>
45+
<phase>install</phase>
46+
<goals>
47+
<goal>copy-resources</goal>
48+
</goals>
4249
<configuration>
43-
<target>
44-
<copy file="${project.build.directory}/${project.build.finalName}.jar"
45-
tofile="${project.x.binaries}/${project.build.finalName}.jar"/>
46-
</target>
50+
<outputDirectory>${project.x.binaries}</outputDirectory>
51+
<resources>
52+
<resource>
53+
<directory>${project.build.directory}</directory>
54+
<includes>
55+
<include>${project.build.finalName}.jar</include>
56+
<include>${project.build.finalName}.jar.asc</include>
57+
</includes>
58+
</resource>
59+
</resources>
4760
</configuration>
61+
</execution>
62+
</executions>
63+
</plugin>
64+
65+
<!-- Generates SHA256 on binaries -->
66+
<plugin>
67+
<groupId>net.nicoulaj.maven.plugins</groupId>
68+
<artifactId>checksum-maven-plugin</artifactId>
69+
<version>1.9</version>
70+
<executions>
71+
<execution>
72+
<phase>install</phase>
4873
<goals>
49-
<goal>run</goal>
74+
<goal>files</goal>
5075
</goals>
5176
</execution>
5277
</executions>
78+
<configuration>
79+
<algorithms>
80+
<algorithm>SHA-256</algorithm>
81+
</algorithms>
82+
<fileSets>
83+
<fileSet>
84+
<directory>${project.x.binaries}</directory>
85+
<excludes>
86+
<exclude>*.sha256</exclude>
87+
<exclude>*.asc</exclude>
88+
</excludes>
89+
</fileSet>
90+
</fileSets>
91+
<csvSummary>false</csvSummary>
92+
</configuration>
5393
</plugin>
5494
</plugins>
5595
</build>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Workaround for JavaDoc issues with Lombok.
3+
*/
4+
public class EmptyJavaDoc {
5+
6+
}

‎odbcprovider/pom.xml

+2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
</parent>
1010

1111
<artifactId>demetra-odbc</artifactId>
12+
<packaging>jar</packaging>
1213

1314
<name>Demetra - ODBC</name>
1415
<description>A TS Provider that handles ODBC datasources.</description>
16+
<url>https://github.com/jdemetra/jdemetra-core</url>
1517

1618
<dependencies>
1719
<!-- compile only -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Workaround for JavaDoc issues with Lombok.
3+
*/
4+
public class EmptyJavaDoc {
5+
6+
}

‎pom.xml

+100-58
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,6 @@
3535
<url>http://github.com/jdemetra/jdemetra-core/tree/master</url>
3636
</scm>
3737

38-
<modules>
39-
<!-- core modules -->
40-
<module>jtstoolkit</module>
41-
<module>jtss</module>
42-
<module>utilities</module>
43-
<module>demetra-tck</module>
44-
<module>demetra-workspace</module>
45-
46-
<!-- I/O modules -->
47-
<module>odbcprovider</module>
48-
<module>jdbcprovider</module>
49-
<module>spreadsheetprovider</module>
50-
<module>sdmxprovider</module>
51-
<module>commonprovider</module>
52-
53-
<!-- several apps -->
54-
<module>jbench</module>
55-
</modules>
56-
5738
<properties>
5839
<sql-util.version>1.0.2</sql-util.version>
5940
</properties>
@@ -161,7 +142,36 @@
161142
</plugins>
162143
</build>
163144

145+
<modules>
146+
<!-- core modules -->
147+
<module>jtstoolkit</module>
148+
<module>jtss</module>
149+
<module>utilities</module>
150+
<module>demetra-tck</module>
151+
<module>demetra-workspace</module>
152+
153+
<!-- I/O modules -->
154+
<module>odbcprovider</module>
155+
<module>jdbcprovider</module>
156+
<module>spreadsheetprovider</module>
157+
<module>sdmxprovider</module>
158+
<module>commonprovider</module>
159+
</modules>
160+
164161
<profiles>
162+
<!-- Non-deployable modules -->
163+
<profile>
164+
<id>non-deployable-modules</id>
165+
<activation>
166+
<property>
167+
<name>!nonDeployableModules</name>
168+
</property>
169+
</activation>
170+
<modules>
171+
<module>jbench</module>
172+
</modules>
173+
</profile>
174+
165175
<!-- Base build java8 -->
166176
<profile>
167177
<id>base-java8</id>
@@ -187,11 +197,6 @@
187197
<artifactId>maven-jar-plugin</artifactId>
188198
<version>3.2.0</version>
189199
</plugin>
190-
<plugin>
191-
<groupId>org.apache.maven.plugins</groupId>
192-
<artifactId>maven-deploy-plugin</artifactId>
193-
<version>3.0.0-M1</version>
194-
</plugin>
195200
</plugins>
196201
</build>
197202
</profile>
@@ -402,67 +407,104 @@
402407
</build>
403408
</profile>
404409

405-
<!-- Deploy SNAPSHOTS to jfrog with sources -->
410+
<!-- Base deploy -->
406411
<profile>
407-
<id>deploy-snapshots</id>
408-
<distributionManagement>
409-
<snapshotRepository>
410-
<id>oss-jfrog-artifactory</id>
411-
<url>https://oss.jfrog.org/artifactory/oss-snapshot-local</url>
412-
</snapshotRepository>
413-
</distributionManagement>
412+
<id>base-deploy</id>
414413
<build>
415414
<plugins>
416-
<plugin>
417-
<groupId>org.apache.maven.plugins</groupId>
418-
<artifactId>maven-deploy-plugin</artifactId>
419-
<version>3.0.0-M1</version>
420-
</plugin>
421415
<plugin>
422416
<groupId>org.apache.maven.plugins</groupId>
423417
<artifactId>maven-source-plugin</artifactId>
424418
<version>3.2.1</version>
425419
<executions>
426420
<execution>
427-
<phase>verify</phase>
421+
<id>attach-sources</id>
428422
<goals>
429423
<goal>jar-no-fork</goal>
430424
</goals>
431425
</execution>
432426
</executions>
433427
</plugin>
428+
<plugin>
429+
<groupId>org.apache.maven.plugins</groupId>
430+
<artifactId>maven-javadoc-plugin</artifactId>
431+
<version>3.2.0</version>
432+
<executions>
433+
<execution>
434+
<id>attach-empty-javadocs</id>
435+
<goals>
436+
<goal>jar</goal>
437+
</goals>
438+
</execution>
439+
</executions>
440+
<configuration>
441+
<excludePackageNames>*</excludePackageNames>
442+
<quiet>true</quiet>
443+
</configuration>
444+
</plugin>
445+
<plugin>
446+
<groupId>org.simplify4u.plugins</groupId>
447+
<artifactId>sign-maven-plugin</artifactId>
448+
<version>0.3.1</version>
449+
<executions>
450+
<execution>
451+
<goals>
452+
<goal>sign</goal>
453+
</goals>
454+
</execution>
455+
</executions>
456+
</plugin>
434457
</plugins>
435458
</build>
436459
</profile>
437460

438-
<!-- Deploy RELEASES to jfrog with sources -->
461+
<!-- Deploy SNAPSHOTS to OSSRH -->
439462
<profile>
440-
<id>deploy-releases</id>
463+
<id>snapshot-deploy</id>
441464
<distributionManagement>
442-
<repository>
443-
<id>oss-jfrog-artifactory</id>
444-
<url>https://oss.jfrog.org/artifactory/oss-release-local</url>
445-
</repository>
465+
<snapshotRepository>
466+
<id>ossrh</id>
467+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
468+
</snapshotRepository>
446469
</distributionManagement>
447470
<build>
448471
<plugins>
449472
<plugin>
450-
<groupId>org.apache.maven.plugins</groupId>
451-
<artifactId>maven-deploy-plugin</artifactId>
452-
<version>3.0.0-M1</version>
473+
<groupId>org.sonatype.plugins</groupId>
474+
<artifactId>nexus-staging-maven-plugin</artifactId>
475+
<version>1.6.8</version>
476+
<extensions>true</extensions>
477+
<configuration>
478+
<serverId>ossrh</serverId>
479+
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
480+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
481+
</configuration>
453482
</plugin>
483+
</plugins>
484+
</build>
485+
</profile>
486+
487+
<!-- Deploy RELEASES to OSSRH -->
488+
<profile>
489+
<id>release-deploy</id>
490+
<distributionManagement>
491+
<repository>
492+
<id>ossrh</id>
493+
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
494+
</repository>
495+
</distributionManagement>
496+
<build>
497+
<plugins>
454498
<plugin>
455-
<groupId>org.apache.maven.plugins</groupId>
456-
<artifactId>maven-source-plugin</artifactId>
457-
<version>3.2.1</version>
458-
<executions>
459-
<execution>
460-
<phase>verify</phase>
461-
<goals>
462-
<goal>jar-no-fork</goal>
463-
</goals>
464-
</execution>
465-
</executions>
499+
<groupId>org.sonatype.plugins</groupId>
500+
<artifactId>nexus-staging-maven-plugin</artifactId>
501+
<version>1.6.8</version>
502+
<extensions>true</extensions>
503+
<configuration>
504+
<serverId>ossrh</serverId>
505+
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
506+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
507+
</configuration>
466508
</plugin>
467509
</plugins>
468510
</build>

‎sdmxprovider/pom.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
</parent>
1010

1111
<artifactId>demetra-sdmx</artifactId>
12-
12+
<packaging>jar</packaging>
13+
1314
<name>Demetra - SDMX</name>
1415
<description>A TS Provider that handles SDMX files.</description>
16+
<url>https://github.com/jdemetra/jdemetra-core</url>
1517

1618
<dependencies>
1719
<!-- compile only -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Workaround for JavaDoc issues with Lombok.
3+
*/
4+
public class EmptyJavaDoc {
5+
6+
}

‎spreadsheetprovider/pom.xml

+2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
</parent>
1010

1111
<artifactId>demetra-spreadsheet</artifactId>
12+
<packaging>jar</packaging>
1213

1314
<name>Demetra - Spreadsheet</name>
1415
<description>A TS Provider that handles Excel and OpenDocument spreadsheets.</description>
16+
<url>https://github.com/jdemetra/jdemetra-core</url>
1517

1618
<properties>
1719
<spreadsheet4j.version>2.2.6</spreadsheet4j.version>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Workaround for JavaDoc issues with Lombok.
3+
*/
4+
public class EmptyJavaDoc {
5+
6+
}

‎utilities/pom.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
</parent>
1111

1212
<artifactId>demetra-utils</artifactId>
13-
13+
<packaging>jar</packaging>
14+
1415
<name>Demetra - Utilities</name>
16+
<description>Seasonal Adjustment Toolkit - Utilities</description>
17+
<url>https://github.com/jdemetra/jdemetra-core</url>
1518

1619
<properties>
1720
<slf4j.version>1.7.30</slf4j.version>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Workaround for JavaDoc issues with Lombok.
3+
*/
4+
public class EmptyJavaDoc {
5+
6+
}

0 commit comments

Comments
 (0)
Please sign in to comment.