-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
145 lines (132 loc) · 5.08 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
pipeline {
agent {
label 'Windows2019'
}
options {
disableConcurrentBuilds()
skipDefaultCheckout(true)
}
environment {
MOD_NAME = 'FicsItCam'
}
stages {
stage('SML') {
steps {
checkout scm: [
$class: 'GitSCM',
branches: [[
name: "auto-header-update"
]],
extensions: [[
$class: 'RelativeTargetDirectory',
relativeTargetDir: 'SatisfactoryModLoader',
],[
$class: 'CloneOption',
timeout: 20,
],[
$class: 'CheckoutOption',
timeout: 20,
]],
userRemoteConfigs: [[
url: 'https://github.com/satisfactorymodding/SatisfactoryModLoader.git'
]]
]
}
}
stage('Checkout') {
steps {
dir("SatisfactoryModLoader/Mods") {
checkout scm: [
$class: 'GitSCM',
branches: scm.branches,
extensions: [[
$class: 'RelativeTargetDirectory',
relativeTargetDir: "${MOD_NAME}"
],[
$class: 'CloneOption',
timeout: 20,
],[
$class: 'CheckoutOption',
timeout: 20,
],[
$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: true,
recursiveSubmodules: true,
reference: '',
trackingSubmodules: false
]],
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 SatisfactoryModding --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 SatisfactoryModding --repo UnrealEngine -l -n "UnrealEngine-CSS-Editor-Win64.7z.002" > UnrealEngine-CSS-Editor-Win64.7z.002'
bat label: 'Download UE - Part 2', script: 'github-release download --user SatisfactoryModding --repo UnrealEngine -l -n "UnrealEngine-CSS-Editor-Win64.7z.003" > UnrealEngine-CSS-Editor-Win64.7z.003'
}
bat label: '', script: '7z x -mmt=10 UnrealEngine-CSS-Editor-Win64.7z.001'
}
bat label: '', script: 'SetupScripts\\Register.bat'
}
}
}
stage('Build FicsIt-Cam') {
steps {
bat label: 'Create project files', script: '.\\ue4\\Engine\\Binaries\\DotNET\\UnrealBuildTool\\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\\Engine\\Build\\BatchFiles\\RunUAT.bat -ScriptsForProject="%WORKSPACE%\\SatisfactoryModLoader\\FactoryGame.uproject" PackagePlugin -project="%WORKSPACE%\\SatisfactoryModLoader\\FactoryGame.uproject" -clientconfig=Shipping -serverconfig=Shipping -utf8output -DLCName="%MOD_NAME%" -build -platform=Win64 -nocompileeditor'
}
}
}
stage('Archive') {
when {
not {
changeRequest()
}
}
steps {
bat script: "rename .\\SatisfactoryModLoader\\Saved\\ArchivedPlugins\\${MOD_NAME}\\${MOD_NAME}-Windows.zip ${MOD_NAME}-Windows_${BRANCH_NAME}_${BUILD_NUMBER}.zip"
archiveArtifacts artifacts: "SatisfactoryModLoader\\Saved\\ArchivedPlugins\\${MOD_NAME}\\${MOD_NAME}-Windows_${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"
}
}
}
}