From d6a3ed0deb358702a3e47234a0719901e1309cac Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Sat, 30 Nov 2019 18:31:58 -0500 Subject: [PATCH] Add branch name to maven artifact --- .travis.yml | 16 ++++------------ build.gradle | 11 ++++------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6dbd96b6..7f427e6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,24 +2,16 @@ language: java jdk: - openjdk8 -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - jobs: include: - stage: check script: ./gradlew check - stage: publish script: ./gradlew build publish - on: - branch: master stages: - - check + - name: check + if: type IN (pull_request) - name: publish - if: env(ACCESS_KEY) + if: NOT type IN (pull_request) + diff --git a/build.gradle b/build.gradle index f0b2838d..d4372c8e 100644 --- a/build.gradle +++ b/build.gradle @@ -13,6 +13,10 @@ sourceCompatibility = JavaVersion.VERSION_1_8 version = "${project.minecraft_version}-${project.version}" +if (System.env.TRAVIS_BRANCH != 'master') { + version += "-${System.env.TRAVIS_BRANCH}" +} + if (project.release != 'RELEASE') { version += "-${project.release}" } @@ -36,13 +40,6 @@ repositories { } } -// check for updates every build when on CI -if (System.env.CI) { - configurations.all { - resolutionStrategy.cacheChangingModulesFor 0, 'seconds' - } -} - dependencies { minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}"