Enable Travis folding in winrelease (#10528)

This commit is contained in:
genotrance 2019-02-02 06:26:32 -06:00 • committed by Andreas Rumpf
commit 07553034de
2 changed files with 21 additions and 12 deletions

View file

@ -373,9 +373,10 @@ proc winReleaseArch(arch: string) =
withMingw r"..\mingw" & arch & r"\bin": withMingw r"..\mingw" & arch & r"\bin":
# Rebuilding koch is necessary because it uses its pointer size to # Rebuilding koch is necessary because it uses its pointer size to
# determine which mingw link to put in the NSIS installer. # determine which mingw link to put in the NSIS installer.
inFold "winrelease koch":
nimexec "c --cpu:$# koch" % cpu nimexec "c --cpu:$# koch" % cpu
kochExec "boot -d:release --cpu:$#" % cpu kochExecFold("winrelease boot", "boot -d:release --cpu:$#" % cpu)
kochExec "--latest zip -d:release" kochExecFold("winrelease zip", "--latest zip -d:release")
overwriteFile r"build\nim-$#.zip" % VersionAsString, overwriteFile r"build\nim-$#.zip" % VersionAsString,
r"web\upload\download\nim-$#_x$#.zip" % [VersionAsString, arch] r"web\upload\download\nim-$#_x$#.zip" % [VersionAsString, arch]
@ -384,12 +385,15 @@ proc winRelease*() =
# anymore! # anymore!
# Build -docs file: # Build -docs file:
when true: when true:
inFold "winrelease buildDocs":
buildDocs(gaCode) buildDocs(gaCode)
withDir "web/upload/" & VersionAsString: withDir "web/upload/" & VersionAsString:
inFold "winrelease zipdocs":
exec "7z a -tzip docs-$#.zip *.html" % VersionAsString exec "7z a -tzip docs-$#.zip *.html" % VersionAsString
overwriteFile "web/upload/$1/docs-$1.zip" % VersionAsString, overwriteFile "web/upload/$1/docs-$1.zip" % VersionAsString,
"web/upload/download/docs-$1.zip" % VersionAsString "web/upload/download/docs-$1.zip" % VersionAsString
when true: when true:
inFold "winrelease csource":
csource("-d:release") csource("-d:release")
when sizeof(pointer) == 4: when sizeof(pointer) == 4:
winReleaseArch "32" winReleaseArch "32"

View file

@ -25,7 +25,6 @@ proc findNim*(): string =
# assume there is a symlink to the exe or something: # assume there is a symlink to the exe or something:
return nim return nim
proc exec*(cmd: string, errorcode: int = QuitFailure, additionalPath = "") = proc exec*(cmd: string, errorcode: int = QuitFailure, additionalPath = "") =
let prevPath = getEnv("PATH") let prevPath = getEnv("PATH")
if additionalPath.len > 0: if additionalPath.len > 0:
@ -38,14 +37,20 @@ proc exec*(cmd: string, errorcode: int = QuitFailure, additionalPath = "") =
if execShellCmd(cmd) != 0: quit("FAILURE", errorcode) if execShellCmd(cmd) != 0: quit("FAILURE", errorcode)
putEnv("PATH", prevPath) putEnv("PATH", prevPath)
template inFold*(desc, body) =
if existsEnv("TRAVIS"):
echo "travis_fold:start:" & desc.replace(" ", "_")
body
if existsEnv("TRAVIS"):
echo "travis_fold:end:" & desc.replace(" ", "_")
proc execFold*(desc, cmd: string, errorcode: int = QuitFailure, additionalPath = "") = proc execFold*(desc, cmd: string, errorcode: int = QuitFailure, additionalPath = "") =
## Execute shell command. Add log folding on Travis CI. ## Execute shell command. Add log folding on Travis CI.
# https://github.com/travis-ci/travis-ci/issues/2285#issuecomment-42724719 # https://github.com/travis-ci/travis-ci/issues/2285#issuecomment-42724719
if existsEnv("TRAVIS"): inFold(desc):
echo "travis_fold:start:" & desc.replace(" ", "_")
exec(cmd, errorcode, additionalPath) exec(cmd, errorcode, additionalPath)
if existsEnv("TRAVIS"):
echo "travis_fold:end:" & desc.replace(" ", "_")
proc execCleanPath*(cmd: string, proc execCleanPath*(cmd: string,
additionalPath = ""; errorcode: int = QuitFailure) = additionalPath = ""; errorcode: int = QuitFailure) =