-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
62 lines (61 loc) · 1.59 KB
/
Jenkinsfile
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
// Repository: https://github.com/bshishov/JenkinsShared
// git (https): https://github.com/bshishov/JenkinsShared.git
@Library('JenkinsShared')_
pipeline {
agent { label 'unity3d' }
environment {
NAME = 'GraveRunner'
NEXUS_URL = "https://nexus.shishov.me"
}
stages {
stage('Build win_x86') {
environment {
PLATFORM = 'win_x86'
BUILD_FILENAME = "${env.NAME}_${env.BRANCH_NAME}_${env.PLATFORM}.zip"
}
steps {
buildUnity3d(
projectPath: env.WORKSPACE,
buildArgs: "-buildTarget Win -buildWindowsPlayer \"${env.WORKSPACE}/builds/${env.PLATFORM}/${env.NAME}.exe\""
)
zipDirectory directory: "builds/${env.PLATFORM}/", file: "builds/${env.BUILD_FILENAME}"
}
}
stage('Build win_x64') {
environment {
PLATFORM = 'win_x64'
BUILD_FILENAME = "${env.NAME}_${env.BRANCH_NAME}_${env.PLATFORM}.zip"
}
steps {
buildUnity3d(
projectPath: env.WORKSPACE,
buildArgs: "-buildTarget Win64 -buildWindows64Player \"${env.WORKSPACE}/builds/${env.PLATFORM}/${env.NAME}.exe\""
)
zipDirectory directory: "builds/${env.PLATFORM}/", file: "builds/${env.BUILD_FILENAME}"
}
}
// TODO: more platforms
stage('Nexus upload') {
steps {
script {
artifacts = findFiles(glob: 'builds/*.zip')
// TODO: make parallel
artifacts.each {
echo "Uploading ${it.name} to nexus"
uploadToNexus3(
filename: it.path,
nexusUrl: env.NEXUS_URL,
targetFilename: "${env.NAME}/${it.name}",
credentialsId: 'nexus-publish'
)
}
}
}
}
}
post {
always {
cleanWs()
}
}
}