From d9d368925f3e09a5c2136c973f82f7ead857d26d Mon Sep 17 00:00:00 2001 From: "J. Fronny" <6260391-JFronny@users.noreply.gitlab.com> Date: Wed, 1 Jul 2020 12:49:22 +0000 Subject: [PATCH] Add .gitlab-ci.yml --- .gitlab-ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..860c584 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,42 @@ +.shared_windows_runners: + tags: + - windows + +before_script: + - dotnet restore + +uptool: + extends: + - .shared_windows_runners + stage: deploy + script: | + $(new-object System.Net.WebClient).DownloadFile("https://gitlab.com/JFronny/UpTool2/-/jobs/artifacts/master/raw/Tools.zip?job=uptool", "$($(pwd).Path)\Tools.zip") + & "C:\Program Files\7-Zip\7z.exe" x .\Tools.zip + rm Tools.zip + rm Install.bat + rm Remove.bat + mkdir .\build + #dotnet publish -o .\build -c Release + & "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe" -noLogo -verbosity:m -p:Configuration=Release + cp .\\PostCompile\bin\Release\net461\* .\build\ + cp .\build\package.zip .\ + $file = Get-Item $(Resolve-Path .\build\*.exe).Path + [timespan]$span = [System.DateTime]::Now - [datetime]'01/01/2000' + [System.XML.XMLDocument]$xml=New-Object System.XML.XMLDocument + [System.XML.XMLElement]$app=$xml.CreateElement("app") + $xml.appendChild($app) + $app.appendChild($xml.CreateElement("Name")).InnerText = "PostCrypt" + $app.appendChild($xml.CreateElement("Description")).InnerText = "Pack .NET FX applications in encrypted EXEs to prevent decompilation (quite easy to bypass)" + $app.appendChild($xml.CreateElement("Version")).InnerText = "1.0." + $span.Days.ToString() + "." + [math]::Round(($span.Seconds + ($span.Minutes + $span.Hours * 60) * 60) / 2).ToString() + $app.appendChild($xml.CreateElement("ID")).InnerText = "ec7cf340-c332-4f67-aa51-42b85b16381c" + $app.appendChild($xml.CreateElement("File")).InnerText = $CI_PROJECT_URL + "/-/jobs/" + $CI_JOB_ID + "/artifacts/raw/package.zip" + $app.appendChild($xml.CreateElement("Hash")).InnerText = $(Get-FileHash .\package.zip).Hash + $app.appendChild($xml.CreateElement("MainFile")).InnerText = "PostCompile.exe" + echo NULL > app.xml + $xml.save($(gi .\app.xml).Fullname) + artifacts: + paths: + - package.zip + - app.xml + only: + - master