This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
testexetrisathlon/.gitlab-ci.yml

52 lines
2.2 KiB
YAML

.shared_windows_runners:
tags:
- shared-windows
- windows
- windows-1809
before_script:
- dotnet restore
uptool:
extends:
- .shared_windows_runners
stage: deploy
script: |
#choco install youtube-dl ffmpeg -y --nocolor --no-progress
#refreshenv
#$env:Path=(
# [System.Environment]::GetEnvironmentVariable("Path","Machine"),
# [System.Environment]::GetEnvironmentVariable("Path","User")
#) -match '.' -join ';'
#My python script to auto-generate requirements would be here but arm64 sux
$(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
$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 = "Terminal based Tetris clone"
$app.appendChild($xml.CreateElement("Version")).InnerText = $asmver
$app.appendChild($xml.CreateElement("ID")).InnerText = "9214aca9-af09-441d-8329-612e77347eba"
$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://gitlab.com/JFronny/testexetrisathlon/-/raw/master/testexetrisathlon/tetris_yUxH6t_256px.ico"
echo NULL > app.xml
$xml.save($(gi .\app.xml).Fullname)
artifacts:
paths:
- package.zip
- app.xml
only:
- master