forked from ServerMod/SCPDiscord
-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Jenkinsfile
113 lines (112 loc) · 4.57 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
pipeline {
agent any
stages {
stage('Download SCP:SL') {
steps {
sh 'steamcmd +force_install_dir \$HOME/scpsl +login anonymous +app_update 996560 validate +quit'
sh 'ln -s "\$HOME/scpsl/SCPSL_Data/Managed" ".scpsl_libs"'
sh 'cp -r "SCPDiscordBot" "AOT"'
sh 'cp -r "SCPDiscordBot" "SMALL"'
sh 'cp -r "SCPDiscordBot" "SC"'
sh 'cp -r "SCPDiscordBot" "AOT_Win"'
sh 'cp -r "SCPDiscordBot" "SMALL_Win"'
sh 'mv "SCPDiscordBot" "SC_Win"'
}
}
stage('Build') {
parallel {
stage('Plugin') {
steps {
sh 'msbuild SCPDiscordPlugin/SCPDiscordPlugin.csproj -restore'
}
}
stage('Bot - Small') {
steps {
dir(path: 'SMALL') {
sh '''dotnet publish\\
-p:PublishSingleFile=true\\
-r linux-x64\\
-c Release\\
--self-contained false\\
--output ./out
'''
}
}
}
stage('Bot - Self Contained') {
steps {
dir(path: 'SC') {
sh '''dotnet publish\\
-p:PublishSingleFile=true\\
-p:PublishTrimmed=true\\
-r linux-x64\\
-c Release\\
--self-contained true\\
--output ./out
'''
}
}
}
stage('Bot - Small (Windows)') {
steps {
dir(path: 'SMALL_Win') {
sh '''dotnet publish\\
-p:PublishSingleFile=true\\
-r win-x64\\
-c Release\\
--self-contained false\\
--output ./out
'''
}
}
}
stage('Bot - Self Contained (Windows)') {
steps {
dir(path: 'SC_Win') {
sh '''dotnet publish\\
-p:PublishSingleFile=true\\
-p:PublishTrimmed=true\\
-r win-x64\\
-c Release\\
--self-contained true\\
--output ./out
'''
}
}
}
}
}
stage('Package') {
parallel {
stage('Plugin') {
steps {
sh 'mkdir dependencies'
sh 'mv SCPDiscordPlugin/bin/SCPDiscord.dll ./'
sh 'mv SCPDiscordPlugin/bin/System.Memory.dll dependencies'
sh 'mv SCPDiscordPlugin/bin/Google.Protobuf.dll dependencies'
sh 'mv SCPDiscordPlugin/bin/Newtonsoft.Json.dll dependencies'
}
}
stage('Bot') {
steps {
sh 'mv SMALL/out/SCPDiscordBot ./SCPDiscordBot_Linux'
sh 'mv SC/out/SCPDiscordBot ./SCPDiscordBot_Linux_SC'
sh 'mv SMALL_Win/out/SCPDiscordBot.exe ./SCPDiscordBot_Windows.exe'
sh 'mv SC_Win/out/SCPDiscordBot.exe ./SCPDiscordBot_Windows_SC.exe'
}
}
}
}
stage('Archive') {
steps {
sh 'zip -r dependencies.zip dependencies'
archiveArtifacts(artifacts: 'dependencies.zip', onlyIfSuccessful: true)
archiveArtifacts(artifacts: 'SCPDiscord.dll', onlyIfSuccessful: true)
archiveArtifacts(artifacts: 'SCPDiscordBot_Linux', onlyIfSuccessful: true)
archiveArtifacts(artifacts: 'SCPDiscordBot_Windows.exe', onlyIfSuccessful: true)
archiveArtifacts(artifacts: 'SCPDiscordBot_Linux_SC', onlyIfSuccessful: true)
archiveArtifacts(artifacts: 'SCPDiscordBot_Windows_SC.exe', onlyIfSuccessful: true)
}
}
}
}