2020-06-18 18:18:53 +02:00
.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 : |
2020-08-31 21:00:19 +02:00
mkdir i
cd i
$(new-object System.Net.WebClient).DownloadFile("https://gitlab.com/JFronny/UpTool2/-/jobs/artifacts/master/raw/Installer-generic.zip?job=uptool", "$($(pwd).Path)\Install.zip")
& "C:\Program Files\7-Zip\7z.exe" x .\Install.zip
.\Installer.exe i -p
cd ..
rm -R i
$Env:Path="$Env:Path;$Env:APPDATA\UpTool2\Install"
uptool --basic remove-repo "UpTool2 official Repo"
uptool --basic add-repo DevTools https://gitlab.com/JFronny/UpTool2/-/snippets/2010392/raw
uptool --basic update
uptool --basic install "UpTool2 package tools"
$Env:Path="$Env:Path;$Env:APPDATA\UpTool2\Apps\0e35d154-d0d3-45e0-b080-62f521263a44\app"
2020-06-18 18:18:53 +02:00
mkdir .\build
dotnet publish -o .\build -c Release
$file = Get-Item $(Resolve-Path .\build\*.exe).Path
2020-08-31 21:00:19 +02:00
pkgtool build --binDir build --mainBin $file --packageFile .\package.zip --noLogo
2020-06-18 18:18:53 +02:00
$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 AutoClicker`r`nFeatures:`r`n- Up to 1000 clicks per second`r`n- Right- and LeftClicks`r`n- Custom Keybinds"
$app.appendChild($xml.CreateElement("Version")).InnerText = $asmver
$app.appendChild($xml.CreateElement("ID")).InnerText = "4863b486-5619-432e-8086-c06e1d5b1f5a"
$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
echo NULL > app.xml
$xml.save($(gi .\app.xml).Fullname)
artifacts :
paths :
- package.zip
- app.xml
only :
- master