This repository has been archived by the owner on Apr 7, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
51 lines (51 loc) · 1.49 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
pipeline {
agent any
stages {
stage('Dependencies') {
steps {
sh 'nuget restore SCPermissions.sln'
}
}
stage('Use upstream Smod') {
when { triggeredBy 'BuildUpstreamCause' }
steps {
sh ('rm SCPermissions/lib/Assembly-CSharp.dll')
sh ('rm SCPermissions/lib/Smod2.dll')
sh ('ln -s $SCPSL_LIBS/Assembly-CSharp.dll SCPermissions/lib/Assembly-CSharp.dll')
sh ('ln -s $SCPSL_LIBS/Smod2.dll SCPermissions/lib/Smod2.dll')
}
}
stage('Build') {
steps {
sh 'msbuild SCPermissions/SCPermissions.csproj -restore -p:PostBuildEvent='
}
}
stage('Setup Output Dir') {
steps {
sh 'mkdir Plugin'
sh 'mkdir Plugin/dependencies'
}
}
stage('Package') {
steps {
sh 'mv SCPermissions/bin/SCPermissions.dll Plugin/'
sh 'mv SCPermissions/bin/YamlDotNet.dll Plugin/dependencies'
sh 'mv SCPermissions/bin/Newtonsoft.Json.dll Plugin/dependencies'
}
}
stage('Archive') {
when { not { triggeredBy 'BuildUpstreamCause' } }
steps {
sh 'zip -r SCPermissions.zip Plugin/*'
archiveArtifacts(artifacts: 'SCPermissions.zip', onlyIfSuccessful: true)
}
}
stage('Send upstream') {
when { triggeredBy 'BuildUpstreamCause' }
steps {
sh 'zip -r SCPermissions.zip Plugin/*'
sh 'cp SCPermissions.zip $PLUGIN_BUILDER_ARTIFACT_DIR'
}
}
}
}