From a5b85dfc47b68642448e13fd2d60b9c72a76ff2e Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Tue, 14 Jan 2020 21:20:19 +0100 Subject: [PATCH] PICARD-1465: For Windows store version combine patch and build number The Windows store allows only a 3 part version number (build number part is reserved for internal store use), but still requires increasing versions on each publication. In order to be able to upload the same release version multiple times, combine the patch number and build number into a single integer with "patch * 100000 + build". E.g. version 2.3.1 with build number 6858 would get a store version of 2.3.106858 --- .github/workflows/package-windows.yml | 3 +-- setup.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/package-windows.yml b/.github/workflows/package-windows.yml index 7e2c6eea1..f206208c6 100644 --- a/.github/workflows/package-windows.yml +++ b/.github/workflows/package-windows.yml @@ -38,8 +38,7 @@ jobs: run: | & .\scripts\package\win-setup.ps1 -DiscidVersion $Env:DISCID_VERSION -FpcalVersion $Env:FPCALC_VERSION Write-Output "::add-path::C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64" - # Write-Output "::set-env name=BUILD_NUMBER::$(git rev-list --count HEAD)" - Write-Output "::set-env name=BUILD_NUMBER::0" + Write-Output "::set-env name=BUILD_NUMBER::$(git rev-list --count HEAD)" New-Item -Name .\artifacts -ItemType Directory env: DISCID_VERSION: 0.6.2 diff --git a/setup.py b/setup.py index 9cdc54ffa..b7449bda9 100644 --- a/setup.py +++ b/setup.py @@ -245,12 +245,13 @@ class picard_build(build): generate_file('win-version-info.txt.in', 'win-version-info.txt', {**args, **version_args}) default_publisher = 'CN=Metabrainz Foundation Inc., O=Metabrainz Foundation Inc., L=San Luis Obispo, S=California, C=US' + store_version = (PICARD_VERSION.major, PICARD_VERSION.minor, PICARD_VERSION.patch * 100000 + self.build_number, 0) generate_file('appxmanifest.xml.in', 'appxmanifest.xml', { 'app-id': "MetaBrainzFoundationInc." + PICARD_APP_ID, 'display-name': PICARD_APP_NAME, # PICARD_DISPLAY_NAME, messed up name reservation. 'short-name': PICARD_APP_NAME, 'publisher': os.environ.get('PICARD_APPX_PUBLISHER', default_publisher), - 'version': file_version_str, + 'version': '.'.join([str(v) for v in store_version]), }) elif sys.platform == 'linux': self.run_command('build_appdata')