set up jenkins

This commit is contained in:
Ell 2020-09-06 21:46:49 +02:00
parent b65b646dc8
commit 7d974b909b
2 changed files with 63 additions and 48 deletions

35
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,35 @@
pipeline {
agent any
stages {
stage('Clean') {
steps {
sh './gradlew clean --no-daemon'
}
}
stage('Build') {
steps {
sh './gradlew build --no-daemon'
}
}
stage('Upload Artifacts') {
steps {
archiveArtifacts 'build/libs/**.jar'
}
}
stage('Publish') {
when {
branch 'master'
}
steps {
sh './gradlew publish --no-daemon'
}
}
}
environment {
local_maven = '/var/www/maven'
}
}

View file

@ -77,67 +77,47 @@ jar {
} }
} }
/*TODO: Re-evaluate
def normalManifest = {
attributes(
"Built-On": "1.14.4",
"Implementation-Title": "ActuallyAdditions",
"Implementation-Version": project.version,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
)
}
jar {
exclude(".cache")
manifest normalManifest
}
task deobfJar(type: Jar) { task deobfJar(type: Jar) {
from sourceSets.main.output from(sourceSets.main.output)
from sourceSets.main.java archiveName = "${baseName}-${version}-deobf.${extension}"
classifier = 'dev'
exclude(".cache")
manifest normalManifest
}
task apiJar(type: Jar) {
from sourceSets.main.output
from sourceSets.main.java
classifier = 'api'
include 'de/ellpeck/actuallyadditions/api/**'
}
javadoc {
include 'de/ellpeck/actuallyadditions/api/**'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from 'build/docs/javadoc'
classifier 'javadoc'
} }
task sourcesJar(type: Jar) { task sourcesJar(type: Jar) {
from sourceSets.main.java from(sourceSets.main.allSource)
classifier = 'sources' archiveName = "${baseName}-${version}-sources.${extension}"
} }
apply plugin: 'maven-publish' artifacts {
archives deobfJar
archives sourcesJar
}
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
artifact jar groupId project.group
artifact apiJar artifactId project.archivesBaseName
artifact javadocJar version project.version
artifact sourcesJar from components.java
artifact deobfJar
artifact deobfJar {
classifier 'deobf'
}
artifact sourcesJar {
classifier 'sources'
}
pom.withXml {
def node = asNode()
if (node.dependencies.size() > 0)
node.remove(node.dependencies)
}
} }
} }
repositories { repositories {
maven { maven {
url "file:///srv/nginx/maven" url "file://" + System.getenv("local_maven")
} }
} }
} }
*/