Fix the root folder name inside CI-built archives

They use HEAD as the branch name, because CI scripting was only fixing
the names of the built archives.
This commit is contained in:
Oliver Hamlet
2016-07-24 21:39:45 +01:00
parent c0454fb496
commit 76f4982fd9
2 changed files with 11 additions and 4 deletions
-3
View File
@@ -37,9 +37,6 @@ after_test:
# AppVeyor checks out a specific commit, but that means the archive script
# can't tell which branch it's on, so rename the 7z archives.
- ps: $env:GIT_DESCRIBE = ((git describe --tags --long) | Out-String) -replace "`n|`r", ""
- ps: mv "build\loot_$($env:GIT_DESCRIBE)_HEAD.7z" "build\loot_$($env:GIT_DESCRIBE)_$($env:APPVEYOR_REPO_BRANCH).7z"
- ps: mv "build\loot-api_$($env:GIT_DESCRIBE)_HEAD.7z" "build\loot-api_$($env:GIT_DESCRIBE)_$($env:APPVEYOR_REPO_BRANCH).7z"
- ps: mv "build\metadata-validator_$($env:GIT_DESCRIBE)_HEAD.7z" "build\metadata-validator_$($env:GIT_DESCRIBE)_$($env:APPVEYOR_REPO_BRANCH).7z"
artifacts:
- path: build\loot_$(GIT_DESCRIBE)_$(APPVEYOR_REPO_BRANCH).7z
+11 -1
View File
@@ -22,12 +22,22 @@ function getGitDescription() {
'--tags',
'--long',
])).slice(0, -1);
const branch = String(childProcess.execFileSync('git', [
let branch = String(childProcess.execFileSync('git', [
'rev-parse',
'--abbrev-ref',
'HEAD',
])).slice(0, -1);
/* On AppVeyor and Travis CI, a specific commit is checked out, so the branch
is HEAD. Use their stored branch value instead. */
if (branch === 'HEAD') {
if (process.env.APPVEYOR_REPO_BRANCH) {
branch = process.env.APPVEYOR_REPO_BRANCH;
} else if (process.env.TRAVIS_BRANCH) {
branch = process.env.TRAVIS_BRANCH;
}
}
return `${describe}_${branch}`;
}