From f7dbac1d6e5ecb3f8d7ac163b718a0d918630b67 Mon Sep 17 00:00:00 2001
From: JFronny <33260128+JFronny@users.noreply.github.com>
Date: Thu, 10 Sep 2020 19:56:54 +0200
Subject: [PATCH] UpTool support (maybe)
---
.gitlab-ci.yml | 48 ++++++++++++++++++++++++
OnScreenKeyboard/OnScreenKeyboard.csproj | 8 ++++
2 files changed, 56 insertions(+)
create mode 100644 .gitlab-ci.yml
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..bd9386c
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,48 @@
+.shared_windows_runners:
+ tags:
+ - windows
+
+image: mcr.microsoft.com/dotnet/core/sdk
+
+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"
+
+ mkdir .\build
+ dotnet publish -o .\build -c Release
+ $file = Get-Item $(Resolve-Path .\build\*.exe).Path
+ pkgtool 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 minigame-based slow text input method for scripts"
+ $app.appendChild($xml.CreateElement("Version")).InnerText = $asmver
+ $app.appendChild($xml.CreateElement("ID")).InnerText = "05281a10-746e-4908-8f6e-93c2ddf0a8ea"
+ $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
diff --git a/OnScreenKeyboard/OnScreenKeyboard.csproj b/OnScreenKeyboard/OnScreenKeyboard.csproj
index 0347cda..52fffb0 100644
--- a/OnScreenKeyboard/OnScreenKeyboard.csproj
+++ b/OnScreenKeyboard/OnScreenKeyboard.csproj
@@ -4,6 +4,14 @@
Exe
netcoreapp3.1
OSK
+ false
+ 1.0.*
+
+
+
+
+ if exist "$(SolutionDir)Data\pkgtool.exe" ($(SolutionDir)Data\pkgtool.exe build --noLogo --binDir .) else if exist "%appdata%\UpTool2\Apps\0e35d154-d0d3-45e0-b080-62f521263a44\app\pkgtool.exe" ("%appdata%\UpTool2\Apps\0e35d154-d0d3-45e0-b080-62f521263a44\app\pkgtool.exe" build --noLogo --binDir .) else echo Cound not find Package build tools, skipping
+