Add CircleCI support

This commit is contained in:
yushijinhun 2018-06-29 21:10:56 +08:00
parent 0113845209
commit 2f3a656d89
No known key found for this signature in database
GPG key ID: 5BC167F73EA558E4

32
.circleci/config.yml Normal file
View file

@ -0,0 +1,32 @@
version: 2
general:
branches:
only:
- master
jobs:
build:
docker:
- image: circleci/openjdk:8-jdk
working_directory: ~/authlib-injector
environment:
JVM_OPTS: -Xmx3200m
TERM: dumb
steps:
- checkout
- restore_cache:
keys:
- v1-cache
- run: 'git clone --single-branch --branch=toolchain --depth=1 git@github.com:yushijinhun/authlib-injector.yushi.moe ~/tools'
- run: 'echo $(( $(~/tools/get-latest-build-number.sh) + 1 )) > ~/build_number && echo "Build Number: $(<~/build_number)"'
- run: '~/tools/authlib-injector-deploy.sh --local-repo ~/authlib-injector.yushi.moe update-local-repo'
- run: 'AI_BUILD_NUMBER="$(<~/build_number)" gradle dependencies'
- run: 'AI_BUILD_NUMBER="$(<~/build_number)" gradle'
- store_artifacts:
path: ~/authlib-injector/build/libs
- run: '~/tools/authlib-injector-deploy.sh upload "$(<~/build_number)" ~/authlib-injector/build/libs/*.jar'
- save_cache:
paths:
- ~/.gradle
- ~/authlib-injector.yushi.moe
key: v1-cache-{{ epoch }}