Skip to content

Commit a566442

Browse files
committed
Streamline CI and release process
1 parent dd9a3b1 commit a566442

6 files changed

Lines changed: 86 additions & 25 deletions

File tree

.travis.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
language: java
2+
jdk: openjdk7
3+
notifications:
4+
email: false
5+
slack:
6+
secure: mQIrH19MBb+r0QKFp1/1pRV4XCzJxZXqkUvaQzhQDe2Mf6zSGGdJlargTIPr6Wz4YvfRymyl13WZXdNavCCWyxUuWEksc1ehvVMU2sMmOWF/fPyntoMvARDozy6woHVICqCiDTtSaQLe5KDnkSgnc1Aebc0DVHBLnXMBmVL3k98vsBsbL4jgtDSVIyRsLSbfbKbZIdcri1kClydW2VjbMOOItJk4g+JjFnc1x6qLRknzmiorwXpYBp6fWab16xMu6NaUnciu78Uo1ycv1UUjMKVfDDT4732Nkmyi1wMS6UQ4k4XElpbuNiy/jdwTXxUuHqg4KEzoNSOr5t5k7yuVWlXCg2P7AqxBPWHxKCS0mlYO4xbOqIp5b91GJiNnokq7CiC/55m1oalWkwpCOCQ7Zli4rDxt0WB9QeKkgRalbxcURBRlakMrLo9QR5LwZAgiDQ1FzFjDqYqYXszppLJjNPyQwJvNbkT0Z19Bk1iu4obN2psEBTkggKrWg1kTRsi0ZaGF94apdBG9JFVtXL1RVz7x/6S4jnZoakAu1NXgafVe56X2ZoFEd6pUjt9NO55C4Cg/BTtJiSQwFJARIGj2MbQsPx7I29c++A0BQWT7mOwFIZ18ppaJGXjpa51Bv0XiZ6n6kanW9dPhYef2oWNUEjKebenOWD/eQK8bYhdNMCw=
7+
env:
8+
global:
9+
- TERM=dumb
10+
11+
install: ./gradlew setupCIWorkspace -S
12+
script: ./gradlew build -S
13+
14+
deploy:
15+
- provider: script
16+
script: ./gradlew curse -S
17+
on:
18+
all_branches: true
19+
repo: CyclopsMC/StructuredCrafting
20+
condition: $TRAVIS_BRANCH =~ ^(master|release).*$
21+
tags: true
22+
- provider: releases
23+
api_key:
24+
secure: KYHDLGt9Udzjx6QS+orXNAVOj/Bo1qoWAK/cX7qUtzRWJ4ZASwfiRvnv80qaMQYLzFYE7qy4QPQ0j2BPUzxyyvYXwddoHbHlR8VPKCrBDeJV/AVaZzJfMx9bntNq9/X4DxF7o8kbLK6T9wkECNgZBi/cu57cvFkQWLbSNV5OQj/z7mURjZ7zlP7wI9tnQEwopvFWWlbh10VoVhN5uopMY+iVST7763EtZD3uG0LKLTrbJo4bM+DhxusfSVGrWMs586KM+xGLjOGiWgaoGxBV0T1f613dP9b3Ge38GJ6e0lgqgMQGHayTXrc0UhJ4TnNL8IhkM1No//bDOcQq8zb1f/FYspZuBiJqp7PbMyYSP81Zz+GHs0DPkcgrL2hSCFSVE2ACDU6lNwEO1WI66RlcYy1b2J3xZ7SJph//2hy0PKo2/R32GUfmbVxaSjGzmAy9xp+h6FYFlWxU9CXudV8vJTTwzaVpZQO3yoRyTjtb2DJAM9xoBeZjHSkK15CKky6minPrdgxWs3g+5lVNYFIJXPYX6G4dZdyRGqu7TV8L3tBm1AA9jM9LRRDhFQQu0lvnAj7eULZWM2WbLA/sEAwC9mgL1+BSpwSctMx1SagNIR+djH3CbxhxkyC1ST7nzIJ5H622+DJwx8pFgxF6aZ8Jl/e6OY/cXKUhhMUwKv6VOZQ=
25+
on:
26+
all_branches: true
27+
repo: CyclopsMC/StructuredCrafting
28+
condition: $TRAVIS_BRANCH =~ ^(master|release).*$
29+
tags: true
30+
- provider: script
31+
script: ./gradlew uploadArchives -S
32+
on:
33+
all_branches: true
34+
repo: CyclopsMC/StructuredCrafting
35+
condition: $TRAVIS_BRANCH =~ ^(master|release).*$

build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,17 @@ def loadProperties() {
3333
prop.load(it)
3434
ext.config = new ConfigSlurper().parse prop
3535
}
36-
36+
3737
// grab buildNumber
3838
ext.buildnumber = "DEV" // this will be referenced as simply project.buildnumber from now on.
3939
if (System.getenv().BUILD_NUMBER)
4040
project.buildnumber = System.getenv().BUILD_NUMBER
41-
if (System.getenv().CI)
42-
project.buildnumber += "-DEV"
43-
if (System.getenv().RELEASE)
41+
if (System.getenv().TRAVIS_BUILD_NUMBER)
42+
project.buildnumber = System.getenv().TRAVIS_BUILD_NUMBER
43+
if (System.getenv().CI) {
44+
//project.buildnumber += "-DEV"
45+
}
46+
if (System.getenv().RELEASE || (System.getenv().TRAVIS_BRANCH && System.getenv().TRAVIS_BRANCH.indexOf("release") > -1))
4447
project.buildnumber = "RELEASE"
4548
logger.lifecycle "BUILDING VERSION: " + project.buildnumber
4649
}

build.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
mod_version=0.1.0
22
minecraft_version=1.8
33
forge_version=11.14.3.1446
4-
cyclopscore_version=0.1.0-DEV
5-
4+
cyclopscore_version=0.1.0-86
5+
release_type=alpha

gradle/deploy.gradle

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
apply plugin: "curseforge"
22
apply plugin: 'maven'
33

4-
if(project.hasProperty("curseforge_key") && project.hasProperty("changelog")) {
5-
curse {
6-
apiKey = project.curseforge_key
7-
projectId = "TODO" // my project url is http://minecraft.curseforge.com/mc-mods/TODO/
8-
changelog = new File(project.changelog).text
9-
releaseType = "release"
4+
curse {
5+
dependsOn 'reobf'
6+
projectId = "" // TODO: my project url is http://minecraft.curseforge.com/mc-mods/232758/
7+
releaseType = project.config.release_type
8+
9+
if (project.buildnumber.equals("RELEASE")) {
10+
changelog = new File("resources/changelog/${project.version}.txt").text
11+
} else {
12+
changelog = ""
13+
}
1014

11-
additionalArtifact deobfJar
12-
additionalArtifact apiJar
13-
additionalArtifact sourceJar
14-
additionalArtifact javadocJar
15+
if(project.hasProperty("curseforge_key") && project.hasProperty("changelog")) {
16+
apiKey = project.curseforge_key
17+
} else if(System.getenv().TRAVIS) {
18+
apiKey = System.getenv().CURSEFORGE_KEY_SECRET
1519
}
20+
21+
additionalArtifact deobfJar
22+
additionalArtifact sourceJar
23+
additionalArtifact javadocJar
1624
}
1725

1826
configurations {
@@ -35,9 +43,14 @@ uploadArchives {
3543
repository(url: project.filesmaven_url) {
3644
authentication(userName: project.filesmaven_username, password: project.filesmaven_key)
3745
}
46+
} else if (System.getenv().MAVEN_URL) {
47+
logger.info('Publishing to files server')
48+
repository(url: System.getenv().MAVEN_URL) {
49+
authentication(userName: System.getenv().MAVEN_USERNAME, password: System.getenv().MAVEN_KEY)
50+
}
3851
} else {
3952
logger.info('Publishing to repo folder')
40-
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
53+
repository(url: 'file://localhost/' + project.file('~/.m2/repository').getAbsolutePath())
4154
}
4255

4356
pom {
@@ -48,18 +61,18 @@ uploadArchives {
4861
pom.project {
4962
name project.archivesBaseName
5063
packaging 'jar'
51-
description 'An evil mod for Minecraft'
52-
url 'https://github.com/rubensworks/EvilCraft'
64+
description 'Craft stuff in your world, automatically.'
65+
url 'https://github.com/CyclopsMC/StructuredCrafting'
5366

5467
scm {
55-
url 'https://github.com/rubensworks/EvilCraft'
56-
connection 'scm:git:git://github.com/rubensworks/EvilCraft.git'
57-
developerConnection 'scm:git:git@github.com:rubensworks/EvilCraft.git'
68+
url 'https://github.com/CyclopsMC/StructuredCrafting'
69+
connection 'scm:git:git://github.com/CyclopsMC/StructuredCrafting.git'
70+
developerConnection 'scm:git:git@github.com:CyclopsMC/StructuredCrafting.git'
5871
}
5972

6073
issueManagement {
6174
system 'github'
62-
url 'https://github.com/rubensworks/EvilCraft/issues'
75+
url 'https://github.com/CyclopsMC/StructuredCrafting/issues'
6376
}
6477

6578
developers {

gradle/forge.gradle

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
repositories {
22
mavenLocal()
33
mavenCentral()
4+
maven {
5+
name "RubensWorks FS"
6+
url "http://maven.rubensworks.net/"
7+
}
48
}
59

610
dependencies {
7-
compile "org.cyclops.cyclopscore:CyclopsCore:${config.minecraft_version}-${config.cyclopscore_version}:deobf"
11+
// Add something like 'cyclopscore_version_local=0.1.0-DEV' to your gradle.properties if you want to use a custom local CyclopsCore version.
12+
if(project.hasProperty("cyclopscore_version_local")) {
13+
compile "org.cyclops.cyclopscore:CyclopsCore:${config.minecraft_version}-${project.cyclopscore_version_local}:deobf"
14+
} else {
15+
compile "org.cyclops.cyclopscore:CyclopsCore:${config.minecraft_version}-${config.cyclopscore_version}:deobf"
16+
}
817

918
// Project lombok
1019
compile "org.projectlombok:lombok:1.14.4"
@@ -29,7 +38,7 @@ minecraft {
2938
mappings = "snapshot_20150401"
3039
}
3140

32-
if (System.getenv().RELEASE)
41+
if (project.buildnumber.equals("RELEASE"))
3342
version = "${config.minecraft_version}-${config.mod_version}"
3443
else
3544
version = "${config.minecraft_version}-${config.mod_version}-${buildnumber}"

resources/changelog/1.8-0.1.0.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
initial release

0 commit comments

Comments
 (0)