Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Commit 2ec1d6b

Browse files
committed
Add Windows file info to build
1 parent 1b63ec9 commit 2ec1d6b

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

appveyor.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,26 @@ after_test:
6161
if ($env:APPVEYOR_REPO_TAG -eq "true") {
6262
$env:BLOBXFER_ARTIFACT = "blobxfer-" + $env:APPVEYOR_REPO_TAG_NAME + "-win-amd64.exe"
6363
$env:UPLOAD_PATH="releases/" + $env:APPVEYOR_REPO_TAG_NAME
64+
$env:BUILDVER_DOTTED = $env:APPVEYOR_REPO_TAG
6465
}
6566
else {
6667
if ($env:APPVEYOR_REPO_BRANCH -eq "master" -Or $env:APPVEYOR_REPO_BRANCH -eq "develop") {
6768
$env:BLOBXFER_ARTIFACT = "blobxfer-" + $env:APPVEYOR_REPO_BRANCH + "-" + $env:APPVEYOR_BUILD_NUMBER + "-win-amd64.exe"
6869
$env:UPLOAD_PATH="builds/" + $env:APPVEYOR_REPO_BRANCH
70+
$env:BUILDVER_DOTTED = [string]::Format("0.0.0.{0}",$env:APPVEYOR_BUILD_NUMBER)
6971
}
7072
else {
7173
Write-Host "Invalid tag or branch $env:APPVEYOR_REPO_BRANCH to build binary"
7274
return
7375
}
7476
}
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+
7584
- IF "%BLOBXFER_ARTIFACT%"=="" (
7685
echo "blobxfer artifact not defined"
7786
) ELSE (
@@ -80,7 +89,11 @@ after_test:
8089
pyi\\Scripts\\activate.bat &&
8190
pip install --upgrade pyinstaller &&
8291
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 &&
8497
pyi\\Scripts\\deactivate.bat &&
8598
appveyor PushArtifact "bin\\%BLOBXFER_ARTIFACT%" &&
8699
bin\\%BLOBXFER_ARTIFACT% upload --remote-path %UPLOAD_PATH% --local-path bin\\%BLOBXFER_ARTIFACT% --strip-components 1 --file-md5 --overwrite

cli/azure.ico

1.12 KB
Binary file not shown.

cli/file_version_info.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
VSVersionInfo(
2+
ffi=FixedFileInfo(
3+
filevers={BUILDVER_TUPLE},
4+
prodvers={BUILDVER_TUPLE},
5+
mask=0x3f,
6+
flags=0x0,
7+
OS=0x40004,
8+
fileType=0x1,
9+
subtype=0x0,
10+
date=(0, 0)
11+
),
12+
kids=[
13+
StringFileInfo(
14+
[
15+
StringTable(
16+
u'040904B0',
17+
[StringStruct(u'CompanyName', u'Microsoft Corporation'),
18+
StringStruct(u'FileDescription', u'blobxfer ({BRANCH_GITSHA1})'),
19+
StringStruct(u'FileVersion', u'{BUILDVER_DOTTED} ({BRANCH_GITSHA1})'),
20+
StringStruct(u'InternalName', u'blobxfer'),
21+
StringStruct(u'LegalCopyright', u'\xa9 Microsoft Corporation. All rights reserved.'),
22+
StringStruct(u'OriginalFilename', u'{EXE}'),
23+
StringStruct(u'ProductName', u'blobxfer'),
24+
StringStruct(u'ProductVersion', u'{BUILDVER_DOTTED}')])
25+
]),
26+
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
27+
]
28+
)

0 commit comments

Comments
 (0)