Build updates

This commit is contained in:
Adubbz 2019-05-04 14:59:07 +10:00
parent a7db4332eb
commit 4c312894b5
2 changed files with 190 additions and 2 deletions

65
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,65 @@
@Library('forge-shared-library')_
pipeline {
options {
disableConcurrentBuilds()
}
agent {
docker {
image 'gradlewrapper:latest'
args '-v gradlecache:/gradlecache'
}
}
environment {
GRADLE_ARGS = '--no-daemon --console=plain' // No daemon for now as FG3 kinda derps. //'-Dorg.gradle.daemon.idletimeout=5000'
JENKINS_HEAD = 'https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png'
}
stages {
stage('fetch') {
steps {
checkout scm
}
}
stage('setup') {
steps {
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue setup'
script {
env.MYVERSION = sh(returnStdout: true, script: './gradlew :properties -q | grep "version:" | awk \'{print $2}\'').trim()
}
}
}
stage('changelog') {
when {
not {
changeRequest()
}
}
steps {
writeChangelog(currentBuild, 'build/changelog.txt')
}
}
stage('publish') {
when {
not {
changeRequest()
}
}
environment {
FORGE_MAVEN_USR = credentials('forge-maven-user')
FORGE_MAVEN_PSW = credentials('forge-maven-password')
}
steps {
sh './gradlew ${GRADLE_ARGS} :publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW}'
sh 'curl --user ${FORGE_MAVEN_USR} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.forge/${MYVERSION}'
}
}
}
post {
always {
script {
archiveArtifacts artifacts: '${WORKSPACE}/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true
}
}
}
}

View File

@ -10,15 +10,20 @@ buildscript {
}
}
plugins {
id "com.matthewprenger.cursegradle" version "1.2.0"
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven'
group = "com.github.glitchfiend.biomesoplenty"
archivesBaseName = "BiomesOPlenty"
// add some stuff to the version
version = "${minecraft_version}-${mod_version}.${System.getenv().BUILD_NUMBER}"
// set this for the version.properties file, or was this broken on purpose?
def build_number = (System.getenv().BUILD_NUMBER) ? System.getenv().BUILD_NUMBER : ""
minecraft {
@ -40,4 +45,122 @@ minecraft {
dependencies {
minecraft 'net.minecraftforge:forge:' + minecraft_version + '-' + forge_version
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
from (sourceSets.main.output) {
include 'LICENSE.txt'
}
classifier = 'sources'
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}
task apiJar(type: Jar) {
from(sourceSets.main.allJava) {
include 'biomesoplenty/api/**'
}
from (sourceSets.main.output) {
include 'LICENSE.txt'
include 'biomesoplenty/api/**'
}
classifier = 'api'
}
curseforge {
if (project.hasProperty('curseApiKey')) {
apiKey = project.getProperty('curseApiKey')
project {
id = '220318'
changelog = file('build/changelog.txt')
releaseType = 'beta'
}
}
}
def changelog = rootProject.file('build/changelog.txt')
artifacts {
if (changelog.exists()) {
archives changelog
}
archives sourcesJar
archives deobfJar
archives apiJar
}
uploadArchives {
repositories {
mavenDeployer {
if (project.hasProperty('forgeMavenPassword')) {
repository(url: "https://files.minecraftforge.net/maven/manage/upload") {
authentication(userName: project.getProperty('forgeMavenUsername'), password: project.getProperty('forgeMavenPassword'))
}
}
else {
// local repo folder. Might wanna juset use gradle install if you wanans end it to maven-local
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
}
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'Biomes O Plenty'
url 'https://github.com/Glitchfiend/BiomesOPlenty'
scm {
url 'https://github.com/Glitchfiend/BiomesOPlenty'
connection 'scm:git:git://github.com/Glitchfiend/BiomesOPlenty.git'
developerConnection 'scm:git:git@github.com:Glitchfiend/BiomesOPlenty.git'
}
issueManagement {
system 'github'
url 'https://github.com/Glitchfiend/BiomesOPlenty/issues'
}
licenses {
license {
name 'Creative Commons Attribution-NonCommercial-NoDerivs 4.0 International Public License'
url 'http://creativecommons.org/licenses/by-nc-nd/4.0/'
distribution 'repo'
}
}
developers {
developer {
id 'Adubbz'
name 'Adubbz'
roles { role 'developer' }
}
developer {
id 'Amnet'
name 'Amnet'
roles { role 'developer' }
}
developer {
id 'Forstride'
name 'Forstride'
roles { role 'developer' }
}
developer {
id 'ted80'
name 'ted80'
roles { role 'developer' }
}
}
}
}
}
}
}