|
|
@ -25,7 +25,7 @@ VersionIniFP = %A_ScriptDir%\Version.ini
|
|
|
|
|
|
|
|
|
|
|
|
; Generate a new errorlog text file each run
|
|
|
|
; Generate a new errorlog text file each run
|
|
|
|
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
|
|
|
|
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
|
|
|
|
ErrorLogTextFile = %A_ScriptDir%\Lib\ErrorLogging\Compiler_%TodayDate%.txt
|
|
|
|
ErrorLogFilepath = %A_ScriptDir%\Lib\ErrorLogging\Compiler_%TodayDate%.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; Read Credential token from Windows Credential Manager using WindowCredentialManager.ahk
|
|
|
|
; Read Credential token from Windows Credential Manager using WindowCredentialManager.ahk
|
|
|
@ -83,7 +83,7 @@ if(!FileExist(icopath)){
|
|
|
|
; run, %comspec% /c ""C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%""
|
|
|
|
; run, %comspec% /c ""C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%""
|
|
|
|
Command = "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%"
|
|
|
|
Command = "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "%AHKFilepath%" /out "%exefilepath%" /icon "%icopath%"
|
|
|
|
Results := RunCMD(Command)
|
|
|
|
Results := RunCMD(Command)
|
|
|
|
LogToErrorLogFile(Results, ErrorLogTextFile)
|
|
|
|
LogToErrorLogFile(Results, ErrorLogFilepath)
|
|
|
|
|
|
|
|
|
|
|
|
if(!InStr(Results, "Successfully")){
|
|
|
|
if(!InStr(Results, "Successfully")){
|
|
|
|
Msgbox, Error, Compilation failed with the following error:`n`n%Results%
|
|
|
|
Msgbox, Error, Compilation failed with the following error:`n`n%Results%
|
|
|
@ -104,10 +104,11 @@ ReleaseTag := VersionNumber
|
|
|
|
Command = Powershell "%CreateReleasePS1Filepath%" "%CreateReleaseAPIURL%" "%ReleaseName%" "%ReleaseTag%" "'%ReleaseBody%'"
|
|
|
|
Command = Powershell "%CreateReleasePS1Filepath%" "%CreateReleaseAPIURL%" "%ReleaseName%" "%ReleaseTag%" "'%ReleaseBody%'"
|
|
|
|
|
|
|
|
|
|
|
|
Message = PowerShell Command to Create Release:`n%Command%
|
|
|
|
Message = PowerShell Command to Create Release:`n%Command%
|
|
|
|
LogToErrorLogFile(Message, ErrorLogTextFile)
|
|
|
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
|
|
|
|
|
|
|
|
|
|
|
Results := RunCMD(Command)
|
|
|
|
Results := RunCMD(Command)
|
|
|
|
LogToErrorLogFile(Results, ErrorLogTextFile)
|
|
|
|
Message = API Returned:`n%Results%
|
|
|
|
|
|
|
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; Pull out the release ID Number, needed for attaching a file to the release
|
|
|
|
; Pull out the release ID Number, needed for attaching a file to the release
|
|
|
@ -116,8 +117,15 @@ SplitText2 = `;
|
|
|
|
ReleaseID := StrSplit(Results, SplitText)[2]
|
|
|
|
ReleaseID := StrSplit(Results, SplitText)[2]
|
|
|
|
ReleaseID := StrSplit(ReleaseID, SplitText2)[1]
|
|
|
|
ReleaseID := StrSplit(ReleaseID, SplitText2)[1]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(ReleaseID = ""){
|
|
|
|
|
|
|
|
Message = Failed to Grab Release ID`nPlease See Errorlog for Details:`n%ErrorLogFilepath%
|
|
|
|
|
|
|
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
|
|
|
|
|
|
|
Msgbox, %Message%
|
|
|
|
|
|
|
|
Return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Message = ReleaseID: %ReleaseID%
|
|
|
|
Message = ReleaseID: %ReleaseID%
|
|
|
|
LogToErrorLogFile(Message, ErrorLogTextFile)
|
|
|
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -129,10 +137,11 @@ AttachAssetToReleaseAPIURL = %AttachAssetToReleaseAPIURL%/%ReleaseID%/assets
|
|
|
|
|
|
|
|
|
|
|
|
; Strings with spaces in them need to be surrounted by a single quote and double quote, eg: "'spaced string'"
|
|
|
|
; Strings with spaces in them need to be surrounted by a single quote and double quote, eg: "'spaced string'"
|
|
|
|
Command = Powershell "%AttachAssetToReleasePS1Filepath%" "%AttachAssetToReleaseAPIURL%" "%GiteaToken%" "'%ExeProgramName%'" "'%Exefilepath%'"
|
|
|
|
Command = Powershell "%AttachAssetToReleasePS1Filepath%" "%AttachAssetToReleaseAPIURL%" "%GiteaToken%" "'%ExeProgramName%'" "'%Exefilepath%'"
|
|
|
|
LogToErrorLogFile(Command, ErrorLogTextFile)
|
|
|
|
LogToErrorLogFile(Command, ErrorLogFilepath)
|
|
|
|
|
|
|
|
|
|
|
|
Results := RunCMD(Command)
|
|
|
|
Results := RunCMD(Command)
|
|
|
|
LogToErrorLogFile(Results, ErrorLogTextFile)
|
|
|
|
Message = API Returned: %Results%
|
|
|
|
|
|
|
|
LogToErrorLogFile(Message, ErrorLogFilepath)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExitApp
|
|
|
|
ExitApp
|
|
|
@ -151,5 +160,5 @@ ExitApp
|
|
|
|
|
|
|
|
|
|
|
|
;---FUNCTIONS-----------------------------------------------------------------------
|
|
|
|
;---FUNCTIONS-----------------------------------------------------------------------
|
|
|
|
LogToErrorLogFile(Text, TextFileFilepath){
|
|
|
|
LogToErrorLogFile(Text, TextFileFilepath){
|
|
|
|
FileAppend, %Text%`n, %TextFileFilepath%
|
|
|
|
FileAppend, `n%Text%`n, %TextFileFilepath%
|
|
|
|
}
|
|
|
|
}
|