Browse Source

Merge branch 'master' of https://github.com/BepInEx/BepInEx

ManlyMarco 5 years ago
parent
commit
f2e88d46cb

+ 4 - 4
BepInEx.Patcher/BepInEx.Patcher.csproj

@@ -31,7 +31,7 @@
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
     <Reference Include="Mono.Cecil, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
     <Reference Include="Mono.Cecil, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
-      <HintPath>..\packages\Mono.Cecil.0.10.3\lib\net35\Mono.Cecil.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Mono.Cecil.0.10.3\lib\net35\Mono.Cecil.dll</HintPath>
     </Reference>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Core" />
@@ -54,8 +54,8 @@
     <PropertyGroup>
     <PropertyGroup>
       <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
       <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
     </PropertyGroup>
     </PropertyGroup>
-    <Error Condition="!Exists('..\packages\ILRepack.2.0.16\build\ILRepack.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ILRepack.2.0.16\build\ILRepack.props'))" />
-    <Error Condition="!Exists('..\packages\ILRepack.Lib.MSBuild.Task.2.0.16.1\build\ILRepack.Lib.MSBuild.Task.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ILRepack.Lib.MSBuild.Task.2.0.16.1\build\ILRepack.Lib.MSBuild.Task.targets'))" />
+    <Error Condition="!Exists('$(SolutionDir)\packages\ILRepack.2.0.16\build\ILRepack.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ILRepack.2.0.16\build\ILRepack.props'))" />
+    <Error Condition="!Exists('$(SolutionDir)\packages\ILRepack.Lib.MSBuild.Task.2.0.16.1\build\ILRepack.Lib.MSBuild.Task.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\ILRepack.Lib.MSBuild.Task.2.0.16.1\build\ILRepack.Lib.MSBuild.Task.targets'))" />
   </Target>
   </Target>
-  <Import Project="..\packages\ILRepack.Lib.MSBuild.Task.2.0.16.1\build\ILRepack.Lib.MSBuild.Task.targets" Condition="Exists('..\packages\ILRepack.Lib.MSBuild.Task.2.0.16.1\build\ILRepack.Lib.MSBuild.Task.targets')" />
+  <Import Project="$(SolutionDir)\packages\ILRepack.Lib.MSBuild.Task.2.0.16.1\build\ILRepack.Lib.MSBuild.Task.targets" Condition="Exists('$(SolutionDir)\packages\ILRepack.Lib.MSBuild.Task.2.0.16.1\build\ILRepack.Lib.MSBuild.Task.targets')" />
 </Project>
 </Project>

+ 1 - 1
BepInEx.Preloader/BepInEx.Preloader.csproj

@@ -24,7 +24,7 @@
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
     <Reference Include="Mono.Cecil, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
     <Reference Include="Mono.Cecil, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
-      <HintPath>..\packages\Mono.Cecil.0.10.3\lib\net35\Mono.Cecil.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Mono.Cecil.0.10.3\lib\net35\Mono.Cecil.dll</HintPath>
     </Reference>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Core" />

+ 1 - 1
BepInEx/BepInEx.csproj

@@ -40,7 +40,7 @@
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
     <Reference Include="Mono.Cecil, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
     <Reference Include="Mono.Cecil, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
-      <HintPath>..\packages\Mono.Cecil.0.10.3\lib\net35\Mono.Cecil.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Mono.Cecil.0.10.3\lib\net35\Mono.Cecil.dll</HintPath>
     </Reference>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System" />
     <Reference Include="UnityEngine">
     <Reference Include="UnityEngine">

+ 1 - 1
README.md

@@ -15,7 +15,7 @@ Unity plugin framework
 
 
 **[Latest releases](https://github.com/BepInEx/BepInEx/releases)**
 **[Latest releases](https://github.com/BepInEx/BepInEx/releases)**
 
 
-**[Bleeding Edge builds](http://builds.bepis.io/bepinex_be)**
+**[Bleeding Edge builds](https://builds.bepis.io/projects/bepinex_be)**
 
 
 **[How to install](https://github.com/bbepis/BepInEx/wiki/How-to-install)**
 **[How to install](https://github.com/bbepis/BepInEx/wiki/How-to-install)**
 
 

+ 55 - 12
scripts/jenkins_master.groovy

@@ -10,6 +10,12 @@ pipeline {
     stages {
     stages {
         stage('Pull Projects') {
         stage('Pull Projects') {
             steps {
             steps {
+                script {
+                    if(fileExists('./last_build_commit'))
+                        lastBuildCommit = readFile 'last_build_commit'
+                    else 
+                        lastBuildCommit = ""
+                }
                 // Clean up old project before starting
                 // Clean up old project before starting
                 cleanWs()
                 cleanWs()
 
 
@@ -36,6 +42,12 @@ Changes since ${latestTag}:
 * [{{hash}}] ({{authorName}}) {{messageTitle}}
 * [{{hash}}] ({{authorName}}) {{messageTitle}}
 {{/merge}}
 {{/merge}}
 {{/commits}}""", to: [type: 'COMMIT', value: "${longCommit}"]
 {{/commits}}""", to: [type: 'COMMIT', value: "${longCommit}"]
+
+                        if(lastBuildCommit != "") {
+                            htmlChangelog = gitChangelog from: [type: 'COMMIT', value: lastBuildCommit], returnType: 'STRING',
+                            template: """<ul>{{#commits}}{{^merge}}<li>[<code>{{hash}}</code>] ({{authorName}}) {{messageTitle}}</li>{{/merge}}{{/commits}}</ul>""", to: [type: 'COMMIT', value: "${longCommit}"] }
+                        else
+                            htmlChangelog = ""
                     }
                     }
 
 
                     sh 'git submodule update --init --recursive'
                     sh 'git submodule update --init --recursive'
@@ -139,29 +151,60 @@ Changes since ${latestTag}:
 
 
                     archiveArtifacts "*.zip"
                     archiveArtifacts "*.zip"
                 }
                 }
+
+                dir('Artifacts') {
+                    sh 'mv ../Build/patcher/*.zip .'
+                    sh 'mv ../Build/dist/*.zip .'
+                }
             }
             }
         }
         }
     }
     }
-       post {
+    post {
+        cleanup {
+            script {
+                writeFile file: 'last_build_commit', text: lastBuildCommit
+            }
+        }
         success {
         success {
-/*
             script {
             script {
+                lastBuildCommit = longCommit
                 if(params.IS_BE) {
                 if(params.IS_BE) {
-                    // Write built BepInEx into bepisbuilds
-                    dir('Build/dist') {
-                        sh "cp BepInEx_x86_${shortCommit}_${versionNumber}.zip /var/www/bepisbuilds/builds/bepinex_be"
-                        sh "cp BepInEx_x64_${shortCommit}_${versionNumber}.zip /var/www/bepisbuilds/builds/bepinex_be"
-                    }
-                    dir('Build/v2018/patcher') {
-                        sh "cp BepInEx_v2018_Patcher_${shortCommit}_${versionNumber}.zip /var/www/bepisbuilds/builds/bepinex_be"
+                    dir('Artifacts') {
+                        def data = [
+                            id: env.BUILD_NUMBER,
+                            date: sh(returnStdout: true, script: 'date -Iseconds -u'),
+                            changelog: htmlChangelog,
+                            artifacts: [
+                                [
+                                    file: "BepInEx_x64${commitPrefix}${versionNumber}.zip",
+                                    description: "BepInEx for x64 machines"
+                                ],
+                                [
+                                    file: "BepInEx_x86${commitPrefix}${versionNumber}.zip",
+                                    description: "BepInEx for x86 machines"
+                                ],
+                                [
+                                    file: "BepInEx_Patcher${commitPrefix}${versionNumber}.zip",
+                                    description: "Hardpatcher for BepInEx. IMPORTANT: USE ONLY IF DOORSTOP DOES NOT WORK FOR SOME REASON!"
+                                ]
+                            ]
+                        ]
+
+                        def json = groovy.json.JsonOutput.toJson(data)
+                        json = groovy.json.JsonOutput.prettyPrint(json)
+                        writeFile file: 'info.json', text: json
+
+                        def filesToSend = findFiles(glob: '*').collect {it.name}
+                        withCredentials([string(credentialsId: 'bepisbuilds_addr', variable: 'BEPISBUILDS_ADDR')]) {
+                            sh """curl --upload-file "{${filesToSend.join(',')}}" --ftp-pasv --ftp-skip-pasv-ip --ftp-create-dirs --ftp-method singlecwd --disable-epsv ftp://${BEPISBUILDS_ADDR}/bepinex_be/artifacts/${env.BUILD_NUMBER}/"""
+                        }
                     }
                     }
-                    sh "echo \"`date -Iseconds -u`;${env.BUILD_NUMBER};${shortCommit};BepInEx_x86_${shortCommit}_${versionNumber}.zip;BepInEx_x64_${shortCommit}_${versionNumber}.zip\" >> /var/www/bepisbuilds/builds/bepinex_be/artifacts_list"
                 }
                 }
             }
             }
-*/
+
             //Notify Bepin Discord of successfull build
             //Notify Bepin Discord of successfull build
             withCredentials([string(credentialsId: 'discord-notify-webhook', variable: 'DISCORD_WEBHOOK')]) {
             withCredentials([string(credentialsId: 'discord-notify-webhook', variable: 'DISCORD_WEBHOOK')]) {
-                discordSend description: "**Build:** [${currentBuild.id}](${env.BUILD_URL})\n**Status:** [${currentBuild.currentResult}](${env.BUILD_URL})\n\n[**Artifacts on BepisBuilds**](http://builds.bepis.io/bepinex_be)", footer: 'Jenkins via Discord Notifier', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), title: "${env.JOB_NAME} #${currentBuild.id}", webhookURL: DISCORD_WEBHOOK
+                discordSend description: "**Build:** [${currentBuild.id}](${env.BUILD_URL})\n**Status:** [${currentBuild.currentResult}](${env.BUILD_URL})\n\n[**Artifacts on BepisBuilds**](https://builds.bepis.io/projects/bepinex_be)", footer: 'Jenkins via Discord Notifier', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), title: "${env.JOB_NAME} #${currentBuild.id}", webhookURL: DISCORD_WEBHOOK
             }
             }
         }
         }
         failure {
         failure {

+ 1 - 1
submodules/BepInEx.Harmony

@@ -1 +1 @@
-Subproject commit e312b4d07326f72bec23d4fd61bbb83fe188bd9c
+Subproject commit a71acb2f2efd21af88e16664b1e7f4ed9632847a