49 lines
2.3 KiB
YAML
49 lines
2.3 KiB
YAML
.shared_windows_runners:
|
|
tags:
|
|
- windows
|
|
|
|
uptool:
|
|
extends:
|
|
- .shared_windows_runners
|
|
stage: deploy
|
|
script: |
|
|
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 --basic i -p
|
|
cd ..
|
|
rm -R i
|
|
$Env:Path="$Env:Path;$Env:APPDATA\UpTool2\Install"
|
|
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"
|
|
|
|
dotnet restore
|
|
mkdir .\build
|
|
& "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe" -noLogo -verbosity:m -p:Configuration=Release
|
|
cp .\cashew\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 = "Cashew"
|
|
$app.appendChild($xml.CreateElement("Description")).InnerText = "A basic GUI for multiple common programming languages including c# and HTML"
|
|
$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 = "63d64672-3ca3-4760-96a3-443b262d326f"
|
|
$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 = "cashew.exe"
|
|
$app.appendChild($xml.CreateElement("Icon")).InnerText = "https://gitlab.com/JFronny/cashew/-/raw/master/cashew/Cashew-64.ico"
|
|
echo NULL > app.xml
|
|
$xml.save($(gi .\app.xml).Fullname)
|
|
artifacts:
|
|
paths:
|
|
- package.zip
|
|
- app.xml
|
|
only:
|
|
- master
|