jinput-arm64/Jenkinsfile

144 lines
5.5 KiB
Plaintext
Raw Normal View History

2018-05-23 01:39:22 +02:00
pipeline {
agent none
triggers { pollSCM('H/15 * * * *') }
2018-05-23 02:00:46 +02:00
tools {
2018-05-23 02:02:13 +02:00
maven 'Maven 3.5.3'
2018-05-23 02:00:46 +02:00
jdk 'OpenJDK 9'
}
2018-05-23 02:29:14 +02:00
options { buildDiscarder(logRotator(numToKeepStr: '5')) }
2018-05-25 21:43:17 +02:00
parameters {
booleanParam(defaultValue: false, description: 'Perform Release', name: 'release')
}
2018-05-23 01:39:22 +02:00
stages {
2018-05-24 22:54:32 +02:00
stage('Build core') {
agent {
label "osx"
}
steps {
sh 'mvn -B -Dmaven.antrun.skip -Dmaven.source.skip -Dmaven.test.skip -DskipTests -DskipITs -pl coreAPI/ package'
}
post {
success {
2018-05-24 22:57:01 +02:00
archiveArtifacts artifacts: 'coreAPI/target/apidocs/**/*', fingerprint: true
2018-05-24 22:54:32 +02:00
}
}
}
stage('Build natives') {
2018-05-23 01:39:22 +02:00
parallel {
stage('Build Windows natives') {
2018-05-23 01:39:22 +02:00
agent {
label "windows"
}
steps {
bat 'mvn -B -am -pl plugins/windows/,plugins/wintab/ clean compile'
2018-05-23 01:39:22 +02:00
}
post {
2018-05-23 02:39:46 +02:00
success {
stash includes: 'plugins/**/target/natives/*.dll', name: 'windows-natives'
2018-05-23 01:39:22 +02:00
}
}
}
stage('Build Linux natives') {
2018-05-23 01:39:22 +02:00
agent {
label "linux"
}
steps {
sh 'mvn -B -am -pl plugins/linux/ clean compile'
2018-05-23 01:39:22 +02:00
}
2018-05-23 18:49:04 +02:00
post {
success {
stash includes: 'plugins/**/target/natives/*.so*', name: 'linux-natives'
2018-05-23 18:49:04 +02:00
}
}
2018-05-23 01:39:22 +02:00
}
stage('Build OSX natives') {
2018-05-23 01:39:22 +02:00
agent {
label "osx"
}
steps {
sh 'mvn -B -am -pl plugins/OSX/ clean compile'
2018-05-23 01:39:22 +02:00
}
post {
2018-05-23 02:39:46 +02:00
success {
stash includes: '**/target/natives/*.jnilib', name: 'osx-natives'
2018-05-23 01:39:22 +02:00
}
}
}
}
}
stage('Build') {
agent {
label "linux"
}
2018-05-23 02:39:46 +02:00
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'
2018-05-23 02:39:46 +02:00
}
post {
success {
stash includes: '**/target/*.jar', name: 'all-java-jars'
2018-05-23 02:39:46 +02:00
archiveArtifacts artifacts: '**/target/*.jar*', fingerprint: true
}
}
}
stage('Deploy') {
agent {
label "linux"
}
2018-05-24 21:54:29 +02:00
when { branch 'master' }
steps {
2018-05-25 21:22:09 +02:00
milestone(1)
unstash 'windows-natives'
unstash 'osx-natives'
unstash 'linux-natives'
2018-05-23 21:39:54 +02:00
sh 'echo $GPG_SECRET_KEYS | base64 --decode | gpg --batch --import'
sh 'echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust'
withMaven(
2018-05-23 23:00:46 +02:00
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"
}
}
}
2018-05-25 22:00:38 +02:00
stage('Release') {
2018-05-25 21:30:38 +02:00
agent {
label "linux"
}
2018-05-25 21:43:17 +02:00
when {
expression {
return params.release
}
}
2018-05-25 21:30:38 +02:00
steps {
2018-05-25 21:22:09 +02:00
milestone(3)
2018-05-25 19:28:11 +02:00
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 versions:set -DremoveSnapshot"
script {
VERSION_TAG = sh(script: "mvn -Dexpression=project.version help:evaluate | grep -e '^[[:digit:]]'", returnStdout: true).trim()
}
sh "git tag -a ${VERSION_TAG} -m 'Release tag ${VERSION_TAG}'"
sh "mvn -P windows,linux,osx,wintab,release -Dmaven.antrun.skip -Dmaven.test.skip -DskipTests -DskipITs deploy"
sh "mvn -P windows,linux,osx,wintab versions:revert"
sh "mvn -P windows,linux,osx,wintab versions:set -DnextSnapshot"
sh "git commit -m 'Next development release' ."
2018-05-25 23:26:29 +02:00
sh "git push --follow-tags"
2018-05-25 19:28:11 +02:00
}
}
}
2018-05-23 01:39:22 +02:00
}
}