Add branch name to maven artifact

This commit is contained in:
Matthew Messinger 2019-11-30 18:31:58 -05:00
parent b6285fb833
commit d6a3ed0deb
2 changed files with 8 additions and 19 deletions

View file

@ -2,24 +2,16 @@ language: java
jdk: jdk:
- openjdk8 - 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: jobs:
include: include:
- stage: check - stage: check
script: ./gradlew check script: ./gradlew check
- stage: publish - stage: publish
script: ./gradlew build publish script: ./gradlew build publish
on:
branch: master
stages: stages:
- check - name: check
if: type IN (pull_request)
- name: publish - name: publish
if: env(ACCESS_KEY) if: NOT type IN (pull_request)

View file

@ -13,6 +13,10 @@ sourceCompatibility = JavaVersion.VERSION_1_8
version = "${project.minecraft_version}-${project.version}" version = "${project.minecraft_version}-${project.version}"
if (System.env.TRAVIS_BRANCH != 'master') {
version += "-${System.env.TRAVIS_BRANCH}"
}
if (project.release != 'RELEASE') { if (project.release != 'RELEASE') {
version += "-${project.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 { dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}" minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}" mappings "net.fabricmc:yarn:${project.yarn_mappings}"