Skip to content

Commit 42d20ca

Browse files
committed
Add upload to Store step to release script.
Fixes #116
1 parent e5a9ef5 commit 42d20ca

File tree

1 file changed

+39
-5
lines changed

1 file changed

+39
-5
lines changed

ci/release.yml

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ parameters:
3535
displayName: "Test Signed"
3636
type: boolean
3737
default: false
38+
- name: StoreAppId
39+
displayName: "Microsoft Store App Id"
40+
type: string
41+
default: 9NQ7512CXL7T
3842

3943

4044
variables:
@@ -46,7 +50,8 @@ variables:
4650
PIP_VERBOSE: true
4751
PYMSBUILD_VERBOSE: true
4852
PYMSBUILD_TEMP_DIR: $(Build.BinariesDirectory)
49-
DIST_DIR: $(Build.ArtifactStagingDirectory)
53+
DIST_DIR: $(Build.ArtifactStagingDirectory)\dist
54+
STORE_DIST_DIR: $(Build.ArtifactStagingDirectory)\store
5055
LAYOUT_DIR: $(Build.BinariesDirectory)\layout
5156
TEST_MSIX_DIR: $(Build.BinariesDirectory)\test_msix
5257
${{ if ne(parameters.OverrideRef, '(tag)') }}:
@@ -69,6 +74,7 @@ stages:
6974
- ${{ if eq(parameters.TestSign, 'true') }}:
7075
- group: CPythonTestSign
7176
- ${{ if eq(parameters.Publish, 'true') }}:
77+
- group: MSFTStorePublish
7278
- group: PythonOrgPublish
7379

7480

@@ -301,7 +307,18 @@ stages:
301307
displayName: 'Remove MSIX'
302308
303309
- ${{ if eq(parameters.Publish, 'true') }}:
310+
- task: UseMSStoreCLI@0
311+
displayName: Setup Microsoft Store Developer CLI
312+
304313
- ${{ if eq(parameters.Sign, 'true') }}:
314+
- powershell: >
315+
msstore reconfigure
316+
--tenantId $(MSSTORE_TENANT_ID)
317+
--sellerId $(MSSTORE_SELLER_ID)
318+
--clientId $(MSSTORE_CLIENT_ID)
319+
--clientSecret $(MSSTORE_CLIENT_SECRET)
320+
displayName: Authenticate Store CLI
321+
305322
- task: DownloadSecureFile@1
306323
name: sshkey
307324
inputs:
@@ -324,10 +341,27 @@ stages:
324341
UPLOAD_DIR: $(DIST_DIR)
325342
326343
- powershell: |
327-
# We don't want the Store MSIX on python.org, so just delete it
328-
# It's already been archived in the earlier publish step, and is bundled
329-
# into the .msixupload file.
330-
del "${env:UPLOAD_DIR}\*-store.msix" -ErrorAction SilentlyContinue
344+
mv "${env:UPLOAD_DIR}\*-store.msix*" (mkdir -Force ${env:STORE_UPLOAD_DIR}) -Verbose
345+
displayName: 'Move Store packages'
346+
env:
347+
UPLOAD_DIR: $(DIST_DIR)
348+
STORE_UPLOAD_DIR: $(STORE_DIST_DIR)
349+
350+
# We begin the submission but do not complete it, so the RM has a chance
351+
# to update metadata before going public. It also means we can do this
352+
# whether signed or not, since a test release can simply be deleted rather
353+
# than published. Existing drafts will be overwritten with new ones.
354+
- powershell: |
355+
$msix = Get-Item "${env:STORE_UPLOAD_DIR}\*.msixupload"
356+
"Uploading $msix"
357+
msstore publish -v -nc -id "${{ parameters.StoreAppId }}" $msix
358+
"MSIX is uploaded."
359+
"Finish publishing at https://partner.microsoft.com/en-us/dashboard/products/${{ parameters.StoreAppId }}/overview"
360+
displayName: 'Begin Store submission'
361+
env:
362+
STORE_UPLOAD_DIR: $(STORE_DIST_DIR)
363+
364+
- powershell: |
331365
python ci\upload.py
332366
displayName: 'Publish packages'
333367
env:

0 commit comments

Comments
 (0)