forked from Panakotta00/FicsIt-Cam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
125 lines (112 loc) · 4.51 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
pipeline {
agent {
label 'Windows2019'
}
options {
disableConcurrentBuilds()
skipDefaultCheckout(true)
}
environment {
MOD_NAME = 'FicsItCam'
}
stages {
stage('SML') {
steps {
checkout scm: [
$class: 'GitSCM',
branches: [[
name: "master"
]],
extensions: [[
$class: 'RelativeTargetDirectory',
relativeTargetDir: 'SatisfactoryModLoader'
]],
userRemoteConfigs: [[
url: 'https://github.com/satisfactorymodding/SatisfactoryModLoader.git'
]]
]
}
}
stage('Checkout') {
steps {
dir("SatisfactoryModLoader/Plugins") {
checkout scm: [
$class: 'GitSCM',
branches: scm.branches,
extensions: [[
$class: 'RelativeTargetDirectory',
relativeTargetDir: "${MOD_NAME}"
]],
submoduleCfg: scm.submoduleCfg,
doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
userRemoteConfigs: scm.userRemoteConfigs
]
}
}
}
stage('Apply Patches') {
steps {
dir("SatisfactoryModLoader") {
//bat label: 'Apply Source Patch', script: 'git apply Plugins\\%MOD_NAME%\\SML_Patch.patch -v'
//bat label: 'Apply Asset Patch', script: 'git apply %ASSETS% -v'
bat label: 'Add WWise', script: '7z x %WWISE_PLUGIN% -oPlugins\\'
}
}
}
stage('Setup UE4') {
steps {
dir('ue4') {
/*withCredentials([string(credentialsId: 'SMR', variable: 'SMR_TOKEN')]) {
retry(5) {
bat label: 'Download UE', script: 'aria2c -x 8 -s 8 -c https://%SMR_TOKEN%@ci.ficsit.app/job/UE-4.25.3-CSS/lastSuccessfulBuild/artifact/UnrealEngine-CSS-Editor-Win64.zip'
}
}
bat label: 'Copy UE', script: 'copy C:\\Jenkins\\UnrealEngine-CSS-Editor-Win64.zip .'
bat label: 'Extract UE', script: '7z x UnrealEngine-CSS-Editor-Win64.zip'
bat label: 'Register UE', script: 'SetupScripts\\Register.bat'*/
withCredentials([string(credentialsId: 'GitHub-API', variable: 'GITHUB_TOKEN')]) {
retry(3) {
bat label: 'Download UE - Part 1', script: 'github-release download --user SatisfactoryModdingUE --repo UnrealEngine -l -n "UnrealEngine-CSS-Editor-Win64.7z.001" > UnrealEngine-CSS-Editor-Win64.7z.001'
bat label: 'Download UE - Part 2', script: 'github-release download --user SatisfactoryModdingUE --repo UnrealEngine -l -n "UnrealEngine-CSS-Editor-Win64.7z.002" > UnrealEngine-CSS-Editor-Win64.7z.002'
}
bat label: '', script: '7z x UnrealEngine-CSS-Editor-Win64.7z.001'
}
bat label: '', script: 'SetupScripts\\Register.bat'
}
}
}
stage('Build FicsIt-Cam') {
steps {
bat label: 'Create project files', script: '.\\ue4\\lb\\win\\Engine\\Binaries\\DotNET\\UnrealBuildTool.exe -projectfiles -project="%WORKSPACE%\\SatisfactoryModLoader\\FactoryGame.uproject" -game -rocket -progress'
bat label: 'Build for Shipping', script: 'MSBuild.exe /p:CL_MPCount=5 .\\SatisfactoryModLoader\\FactoryGame.sln /p:Configuration="Shipping" /p:Platform="Win64" /t:"Games\\FactoryGame"'
bat label: 'Build for Editor', script: 'MSBuild.exe /p:CL_MPCount=5 .\\SatisfactoryModLoader\\FactoryGame.sln /p:Configuration="Development Editor" /p:Platform="Win64" /t:"Games\\FactoryGame"'
}
}
stage('Package FicsIt-Cam') {
steps {
retry(3) {
bat label: 'Alpakit!', script: '.\\ue4\\lb\\win\\Engine\\Build\\BatchFiles\\RunUAT.bat -ScriptsForProject="%WORKSPACE%\\SatisfactoryModLoader\\FactoryGame.uproject" PackagePlugin -Project="%WORKSPACE%\\SatisfactoryModLoader\\FactoryGame.uproject" -PluginName="%MOD_NAME%"'
}
}
}
stage('Archive') {
when {
not {
changeRequest()
}
}
steps {
bat script: "rename .\\SatisfactoryModLoader\\Saved\\ArchivedPlugins\\WindowsNoEditor\\${MOD_NAME}.zip ${MOD_NAME}_${BRANCH_NAME}_${BUILD_NUMBER}.zip"
archiveArtifacts artifacts: "SatisfactoryModLoader\\Saved\\ArchivedPlugins\\WindowsNoEditor\\${MOD_NAME}_${BRANCH_NAME}_${BUILD_NUMBER}.zip", fingerprint: true, onlyIfSuccessful: true
}
}
}
post {
always {
cleanWs()
withCredentials([string(credentialsId: 'FINDiscordToken_FicsItCam', variable: 'WEBHOOKURL')]) {
discordSend description: "FIC Build", link: env.BUILD_URL, result: currentBuild.currentResult, title: JOB_NAME, webhookURL: "$WEBHOOKURL"
}
}
}
}