forked from NyaaCat/ce
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
37 lines (36 loc) · 1.36 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
language: java
jdk: oraclejdk8
install: true
before_script:
- export MAJOR_VERSION=`sed -n 's/^ext\.majorVersion = \(.*\)$/\1/p' build.gradle`
- export MINOR_VERSION=`sed -n 's/^ext\.minorVersion = "\(.*\)"$/\1/p' build.gradle`
- export MC_VERSION=`sed -n 's/^ext\.minecraftVersion = "\(.*\)"$/\1/p' build.gradle`
- export VERSION_STRING=$MAJOR_VERSION.$MINOR_VERSION.$TRAVIS_BUILD_NUMBER-mc$MC_VERSION
- 'sed -i "s/^\(version: \).*\$/\1$VERSION_STRING/g" src/main/resources/plugin.yml'
script: gradle build
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -f $HOME/.gradle/caches/3.5/fileHashes/fileHashes.bin
- rm -f $HOME/.gradle/caches/3.5/fileHashes/fileHashes.lock
- rm -f $HOME/.gradle/caches/transforms-1/transforms-1.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
before_deploy:
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
- export GIT_TAG=v$VERSION_STRING
- git tag $GIT_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER"
- cp build/libs/ce.jar ./ce-v$VERSION_STRING.jar
deploy:
skip_cleanup: true
provider: releases
prerelease: true
api_key: $GITHUB_DEPLOY_KEY
file: ./ce-v$VERSION_STRING.jar
branches:
except:
- "/^*-v[0-9]/"
- "/^*-mc/"