-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
97 lines (89 loc) · 2.35 KB
/
.gitlab-ci.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# This file is a template and might need editing before it works on your project.
# This is the Gradle build system for JVM applications
# https://gradle.org/
# https://github.com/gradle/gradle
image: gradle:jdk17
# Disable the Gradle daemon for Continuous Integration servers as correctness
# is usually a priority over speed in CI environments. Using a fresh
# runtime for each build is more reliable since the runtime is completely
# isolated from any previous builds.
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
cache:
key:
files:
- build.gradle
- gradle.properties
paths:
- build
- .gradle
assemble:
stage: build
script: ./gradlew assemble
except:
- develop
- master
- merge_requests
- tags
check:
stage: test
script: ./gradlew check
except:
- develop
- master
- merge_requests
- tags
build:
stage: build
script: ./gradlew build
only:
- develop
- master
- merge_requests
- tags
artifacts:
paths:
- build/libs/*.jar
dotenv:
before_script: []
cache: []
variables: {}
image: registry.gitlab.com/gitlab-org/release-cli:latest
stage: .pre
script:
- echo "VERSION=$(cat gradle.properties | grep 'mod_version' | cut -d '=' -f 2)" > .env
- echo "MINECRAFT=$(cat gradle.properties | grep 'minecraft_version' | cut -d '=' -f 2)" >> .env
- cat .env
only:
- tags
artifacts:
reports:
dotenv: .env
release:
before_script: []
cache: []
variables: {}
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: build
artifacts: true
- job: dotenv
artifacts: true
only:
- tags
script:
- 'echo "Version: $VERSION"'
stage: deploy
release:
tag_name: "$CI_COMMIT_TAG"
description: "$CI_COMMIT_MESSAGE"
assets:
links:
- name: "switcheroo-$CI_COMMIT_TAG+$MINECRAFT-sources.jar"
url: "https://gitlab.com/NatoBoram/fabric-switcheroo/-/jobs/artifacts/$CI_COMMIT_TAG/raw/build/libs/switcheroo-$VERSION+$MINECRAFT-sources.jar?job=build"
link_type: "other"
- name: "switcheroo-$CI_COMMIT_TAG+$MINECRAFT.jar"
url: "https://gitlab.com/NatoBoram/fabric-switcheroo/-/jobs/artifacts/$CI_COMMIT_TAG/raw/build/libs/switcheroo-$VERSION+$MINECRAFT.jar?job=build"
link_type: "package"