From 03e7ea48292ac5f941d8946540368c41e05ed54e Mon Sep 17 00:00:00 2001 From: "J. Fronny" <6260391-JFronny@users.noreply.gitlab.com> Date: Sat, 20 Jun 2020 10:55:12 +0000 Subject: [PATCH] Add .gitlab-ci.yml --- .gitlab-ci.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..30368db --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,49 @@ +.shared_windows_runners: + tags: + - shared-windows + - windows + - windows-1809 + +image: mcr.microsoft.com/dotnet/core/sdk + +before_script: + - dotnet restore + +uptool: + extends: + - .shared_windows_runners + stage: deploy + script: | + choco install ffmpeg python -y --nocolor --no-progress + python DownloadDataDepsInstall.py + python DownloadData.py + $(new-object System.Net.WebClient).DownloadFile("https://www.github.com/JFronny/UpTool2/releases/latest/download/Tools.zip", "$($(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 + $file = Get-Item $(Resolve-Path .\build\*.exe).Path + .\Data\pkgtool.exe build --binDir build --mainBin $file --packageFile .\package.zip --noLogo + $asm = $([Reflection.Assembly]::LoadFile($file.DirectoryName + "\" + $file.BaseName + ".dll")) + $asmver = $asm.GetName().Version.ToString() + [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 = $asm.GetName().Name + $app.appendChild($xml.CreateElement("Description")).InnerText = "A simple Snake clone that runs in the terminal. Supports color and Benchmarking" + $app.appendChild($xml.CreateElement("Version")).InnerText = $asmver + $app.appendChild($xml.CreateElement("ID")).InnerText = "51dd476c-de2f-40c6-a587-0af62f1dbebb" + $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 = $file.Name + $app.appendChild($xml.CreateElement("Icon")).InnerText = "https://raw.githubusercontent.com/JFronny/testexetrisathlon/master/testexetrisathlon/tetris_yUxH6t_256px.ico" + echo NULL > app.xml + $xml.save($(gi .\app.xml).Fullname) + artifacts: + paths: + - package.zip + - app.xml + only: + - master