From 278a878b09fc08d5a854f3d11c736738c90a31d4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 19 Apr 2018 15:52:24 +0900 Subject: [PATCH 1/3] Add non-interactive deploy mode --- osu.Desktop.Deploy/Program.cs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs index 6095ce062d..8c460f03cf 100644 --- a/osu.Desktop.Deploy/Program.cs +++ b/osu.Desktop.Deploy/Program.cs @@ -57,8 +57,12 @@ namespace osu.Desktop.Deploy private static string codeSigningPassword; + private static bool interactive; + public static void Main(string[] args) { + interactive = args.Length == 0; + displayHeader(); findSolutionPath(); @@ -82,15 +86,15 @@ namespace osu.Desktop.Deploy string version = $"{verBase}{increment}"; Console.ForegroundColor = ConsoleColor.White; - Console.Write($"Ready to deploy {version}: "); - Console.ReadLine(); + Console.Write($"Ready to deploy {version}!"); + pauseIfInteractive(); sw.Start(); if (!string.IsNullOrEmpty(CodeSigningCertificate)) { Console.Write("Enter code signing password: "); - codeSigningPassword = readLineMasked(); + codeSigningPassword = args.Length > 0 ? args[0] : readLineMasked(); } write("Updating AssemblyInfo..."); @@ -124,7 +128,7 @@ namespace osu.Desktop.Deploy updateCsprojVersion("0.0.0"); write("Done!", ConsoleColor.White); - Console.ReadLine(); + pauseIfInteractive(); } private static void displayHeader() @@ -388,10 +392,18 @@ namespace osu.Desktop.Deploy Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"FATAL ERROR: {message}"); - Console.ReadLine(); + pauseIfInteractive(); Environment.Exit(-1); } + private static void pauseIfInteractive() + { + if (interactive) + Console.ReadLine(); + else + Console.WriteLine(); + } + private static void write(string message, ConsoleColor col = ConsoleColor.Gray) { if (sw.ElapsedMilliseconds > 0) From 312068d7a29716ab1737c4aa86b4a3bee6153df4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 19 Apr 2018 17:15:06 +0900 Subject: [PATCH 2/3] Add deploy config --- appveyor_deploy.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 appveyor_deploy.yml diff --git a/appveyor_deploy.yml b/appveyor_deploy.yml new file mode 100644 index 0000000000..3887557fcb --- /dev/null +++ b/appveyor_deploy.yml @@ -0,0 +1,28 @@ +# 2017-09-14 +clone_depth: 1 +version: '{branch}-{build}' +image: Visual Studio 2017 +configuration: Debug +cache: + - packages -> **\packages.config +install: + - cmd: git submodule update --init --recursive --depth=5 +before_build: + - cmd: nuget restore -verbosity quiet +build: + project: osu.Desktop.Deploy/osu.Desktop.Deploy.csproj + verbosity: minimal +after_build: + - ps: iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1')) + - appveyor DownloadFile https://puu.sh/A6g5K/4d08705438.enc # signing certificate + - cmd: appveyor-tools\secure-file -decrypt 4d08705438.enc -secret %decode_secret% -out %HOMEPATH%\deanherbert.pfx + - appveyor DownloadFile https://puu.sh/A6g75/fdc6f19b04.enc # deploy configuration + - cmd: appveyor-tools\secure-file -decrypt fdc6f19b04.enc -secret %decode_secret% -out osu.Desktop.Deploy\bin\Debug\net461\osu.Desktop.Deploy.exe.config + - cd osu.Desktop.Deploy\bin\Debug\net461\ + - osu.Desktop.Deploy.exe %code_signing_password% +environment: + TargetFramework: net461 + decode_secret: + secure: i67IC2xj6DjjxmA6Oj2jing3+MwzLkq6CbGsjfZ7rdY= + code_signing_password: + secure: 34tLNqvjmmZEi97MLKfrnQ== From 8a243461a697d6cfcf1c8adec6167fb523b22775 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 19 Apr 2018 17:42:06 +0900 Subject: [PATCH 3/3] Expose appveyor artifacts --- appveyor_deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor_deploy.yml b/appveyor_deploy.yml index 3887557fcb..cd241eb88f 100644 --- a/appveyor_deploy.yml +++ b/appveyor_deploy.yml @@ -26,3 +26,5 @@ environment: secure: i67IC2xj6DjjxmA6Oj2jing3+MwzLkq6CbGsjfZ7rdY= code_signing_password: secure: 34tLNqvjmmZEi97MLKfrnQ== +artifacts: + - path: 'Releases\*' \ No newline at end of file