Merge pull request #33 from jinput/jenkinsfile

Jenkinsfile
This commit is contained in:
Endolf 2018-05-24 20:03:25 +01:00 committed by GitHub
commit f228dbcf59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 184 additions and 136 deletions

91
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,91 @@
pipeline {
agent none
triggers { pollSCM('H/15 * * * *') }
tools {
maven 'Maven 3.5.3'
jdk 'OpenJDK 9'
}
options { buildDiscarder(logRotator(numToKeepStr: '5')) }
stages {
stage('Build natives') {
parallel {
stage('Build Windows natives') {
agent {
label "windows"
}
steps {
bat 'mvn -B -am -pl plugins/windows/,plugins/wintab/ clean compile'
}
post {
success {
stash includes: 'plugins/**/target/natives/*.dll', name: 'windows-natives'
}
}
}
stage('Build Linux natives') {
agent {
label "linux"
}
steps {
sh 'mvn -B -am -pl plugins/linux/ clean compile'
}
post {
success {
stash includes: 'plugins/**/target/natives/*.so*', name: 'linux-natives'
}
}
}
stage('Build OSX natives') {
agent {
label "osx"
}
steps {
sh 'mvn -B -am -pl plugins/OSX/ clean compile'
}
post {
success {
stash includes: '**/target/natives/*.jnilib', name: 'osx-natives'
}
}
}
}
}
stage('Build') {
agent {
label "linux"
}
steps {
unstash 'windows-natives'
unstash 'osx-natives'
unstash 'linux-natives'
sh 'mvn -B -P windows,linux,osx,wintab -Dmaven.antrun.skip -Dmaven.javadoc.skip -Dmaven.source.skip -Dmaven.test.skip -DskipTests -DskipITs package'
}
post {
success {
stash includes: '**/target/*.jar', name: 'all-java-jars'
archiveArtifacts artifacts: '**/target/*.jar*', fingerprint: true
}
}
}
stage('Deploy') {
agent {
label "linux"
}
steps {
unstash 'windows-natives'
unstash 'osx-natives'
unstash 'linux-natives'
sh 'echo $GPG_SECRET_KEYS | base64 --decode | gpg --batch --import'
sh 'echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust'
withMaven(
maven: 'Maven 3.5.3',
jdk: 'OpenJDK 9',
globalMavenSettingsConfig: 'global-maven-settings-ossrh',
mavenOpts: '-Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts' //Work around for JDK9 missing cacerts
) {
sh "mvn -P windows,linux,osx,wintab -Dmaven.antrun.skip -Dmaven.test.skip -DskipTests -DskipITs deploy"
}
}
}
}
}

View file

@ -11,28 +11,65 @@
<relativePath>../</relativePath>
</parent>
<repositories>
<repository>
<id>central-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.java.jinput</groupId>
<artifactId>coreapi</artifactId>
<version>${project.version}</version>
</dependency>
<!--
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>windows-plugin</artifactId>
<version>${project.version}</version>
<classifier>natives-windows</classifier>
</dependency>
-->
<!--
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>osx-plugin</artifactId>
<version>${project.version}</version>
<classifier>natives-osx</classifier>
</dependency>
-->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>windows-plugin</artifactId>
<version>${project.version}</version>
<classifier>natives-windows</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>osx-plugin</artifactId>
<version>${project.version}</version>
<classifier>natives-osx</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>wintab-plugin</artifactId>
<version>${project.version}</version>
<classifier>natives-wintab</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>linux-plugin</artifactId>
<version>${project.version}</version>
<classifier>natives-linux</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>windows-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>osx-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>wintab-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>linux-plugin</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
@ -51,93 +88,6 @@
</build>
<profiles>
<profile>
<id>linux</id>
<activation>
<os>
<family>linux</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>linux-plugin</artifactId>
<version>${project.version}</version>
<classifier>natives-linux</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>linux-plugin</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>osx</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>osx-plugin</artifactId>
<version>${project.version}</version>
<classifier>natives-osx</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>osx-plugin</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>windows-plugin</artifactId>
<version>${project.version}</version>
<classifier>natives-windows</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>windows-plugin</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>wintab</id>
<activation>
<os>
<family>windows</family>
</os>
<property>
<name>env.WINTABSDKDIR</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>wintab-plugin</artifactId>
<version>${project.version}</version>
<classifier>natives-wintab</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>wintab-plugin</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>ReadAllEvents</id>
<build>

View file

@ -17,7 +17,7 @@
<profiles>
<profile>
<id>Linux</id>
<id>linux</id>
<activation>
<os>
<name>linux</name>
@ -28,7 +28,7 @@
</modules>
</profile>
<profile>
<id>Windows</id>
<id>windows</id>
<activation>
<os>
<family>windows</family>
@ -39,7 +39,7 @@
</modules>
</profile>
<profile>
<id>OSX</id>
<id>osx</id>
<activation>
<os>
<family>mac</family>

67
pom.xml
View file

@ -26,6 +26,17 @@
<developerConnection>scm:git:https://github.com/jinput/jinput.git</developerConnection>
</scm>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.6</maven.compiler.source>
@ -119,35 +130,31 @@
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>