@@ -61,17 +61,26 @@ after_test:
61
61
if ($env:APPVEYOR_REPO_TAG -eq "true") {
62
62
$env:BLOBXFER_ARTIFACT = "blobxfer-" + $env:APPVEYOR_REPO_TAG_NAME + "-win-amd64.exe"
63
63
$env:UPLOAD_PATH="releases/" + $env:APPVEYOR_REPO_TAG_NAME
64
+ $env:BUILDVER_DOTTED = $env:APPVEYOR_REPO_TAG
64
65
}
65
66
else {
66
67
if ($env:APPVEYOR_REPO_BRANCH -eq "master" -Or $env:APPVEYOR_REPO_BRANCH -eq "develop") {
67
68
$env:BLOBXFER_ARTIFACT = "blobxfer-" + $env:APPVEYOR_REPO_BRANCH + "-" + $env:APPVEYOR_BUILD_NUMBER + "-win-amd64.exe"
68
69
$env:UPLOAD_PATH="builds/" + $env:APPVEYOR_REPO_BRANCH
70
+ $env:BUILDVER_DOTTED = [string]::Format("0.0.0.{0}",$env:APPVEYOR_BUILD_NUMBER)
69
71
}
70
72
else {
71
73
Write-Host "Invalid tag or branch $env:APPVEYOR_REPO_BRANCH to build binary"
72
74
return
73
75
}
74
76
}
77
+
78
+ $bvt0,$bvt1,$bvt2,$bvt3 = $env:BUILDVER_DOTTED.split('.')
79
+
80
+ $env:BUILDVER_TUPLE = [string]::Format("({0}, {1}, {2}, {3})",$bvt0,$bvt1,$bvt2,$bvt3)
81
+
82
+ $env:BRANCH_GITSHA1 = [string]::Format("{0}@{1}",$env:APPVEYOR_REPO_BRANCH,$env:APPVEYOR_REPO_COMMIT.Substring(0,7))
83
+
75
84
- IF "%BLOBXFER_ARTIFACT%"=="" (
76
85
echo "blobxfer artifact not defined"
77
86
) ELSE (
@@ -80,7 +89,11 @@ after_test:
80
89
pyi\\Scripts\\activate.bat &&
81
90
pip install --upgrade pyinstaller &&
82
91
pip install -e . &&
83
- pyinstaller -F -n "%BLOBXFER_ARTIFACT%" -p blobxfer:cli --additional-hooks-dir blobxfer --exclude-module future.tests --exclude-module future.backports.test --exclude-module future.moves.test --distpath bin cli\\cli.py &&
92
+ sed -i -e "s/{BUILDVER_TUPLE}/%BUILDVER_TUPLE%/g" cli\\file_version_info.txt &&
93
+ sed -i -e "s/{BUILDVER_DOTTED}/%BUILDVER_DOTTED%/g" cli\\file_version_info.txt &&
94
+ sed -i -e "s/{BRANCH_GITSHA1}/%BRANCH_GITSHA1%/g" cli\\file_version_info.txt &&
95
+ sed -i -e "s/{EXE}/%BLOBXFER_ARTIFACT%/g" cli\\file_version_info.txt &&
96
+ pyinstaller -F -n "%BLOBXFER_ARTIFACT%" -p blobxfer:cli --additional-hooks-dir blobxfer --exclude-module future.tests --exclude-module future.backports.test --exclude-module future.moves.test --icon cli\\azure.ico --version-file cli\\file_version_info.txt --distpath bin cli\\cli.py &&
84
97
pyi\\Scripts\\deactivate.bat &&
85
98
appveyor PushArtifact "bin\\%BLOBXFER_ARTIFACT%" &&
86
99
bin\\%BLOBXFER_ARTIFACT% upload --remote-path %UPLOAD_PATH% --local-path bin\\%BLOBXFER_ARTIFACT% --strip-components 1 --file-md5 --overwrite
0 commit comments