Skip to content

Commit ca093ba

Browse files
committed
Well, rewrite the whole thing to auth to azure instead
1 parent ed249bc commit ca093ba

File tree

1 file changed

+50
-37
lines changed

1 file changed

+50
-37
lines changed

.github/workflows/msstore-submissions.yml

+50-37
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@ name: Store submission on release
22

33
on:
44
workflow_dispatch:
5-
release:
6-
types: [published]
5+
#release:
6+
# types: [published]
77

88
jobs:
99

1010
microsoft_store:
1111
name: Publish Microsoft Store
12+
environment: store
1213
runs-on: ubuntu-latest
1314
steps:
15+
- name: Log in to Azure
16+
uses: azure/login@v2
17+
with:
18+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
19+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
20+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
21+
enable-AzPSSession: true
22+
1423
- name: Get latest URL from public releases
1524
id: releaseVars
1625
run: |
@@ -20,41 +29,45 @@ jobs:
2029
echo ::set-output name=powerToysInstallerX64Url::$(jq -n "$powerToysSetup" | jq -r '[.[]|select(.name | contains("x64"))][0].browser_download_url')
2130
echo ::set-output name=powerToysInstallerArm64Url::$(jq -n "$powerToysSetup" | jq -r '[.[]|select(.name | contains("arm64"))][0].browser_download_url')
2231
23-
- name: Configure Store Credentials
24-
uses: microsoft/store-submission@v1
32+
- uses: microsoft/setup-msstore-cli
33+
34+
- name: Fetch Store Credential
35+
uses: azure/cli@v2
2536
with:
26-
command: configure
27-
type: win32
28-
seller-id: ${{ secrets.SELLER_ID }}
29-
product-id: ${{ secrets.PRODUCT_ID }}
30-
tenant-id: ${{ secrets.TENANT_ID }}
31-
client-id: ${{ secrets.CLIENT_ID }}
32-
client-secret: ${{ secrets.CLIENT_SECRET }}
37+
azcliversion: latest
38+
inlineScript: |-
39+
az keyvault secret download --vault-name ${{ vars.AKV_NAME }} -n ${{ vars.CERT_NAME }} -f cert.pfx
40+
41+
- name: Configure Store Credentials
42+
run: |-
43+
msstore-cli reconfigure -cfp cert.pfx -c ${{ secrets.AZURE_CLIENT_ID }} -t ${{ secrets.AZURE_TENANT_ID }} -s ${{ secrets.SELLER_ID }}
3344
3445
- name: Update draft submission
35-
uses: microsoft/store-submission@v1
36-
with:
37-
command: update
38-
product-update: '{
39-
"packages":[
40-
{
41-
"packageUrl":"${{ steps.releaseVars.outputs.powerToysInstallerX64Url }}",
42-
"languages":["zh-hans", "zh-hant", "en", "cs", "nl", "fr", "pt", "pt-br", "de", "hu", "it", "ja", "ko", "pl", "ru", "es", "tr"],
43-
"architectures":["X64"],
44-
"installerParameters":"/quiet /norestart",
45-
"isSilentInstall":true
46-
},
47-
{
48-
"packageUrl":"${{ steps.releaseVars.outputs.powerToysInstallerArm64Url }}",
49-
"languages":["zh-hans", "zh-hant", "en", "cs", "nl", "fr", "pt", "pt-br", "de", "hu", "it", "ja", "ko", "pl", "ru", "es", "tr"],
50-
"architectures":["Arm64"],
51-
"installerParameters":"/quiet /norestart",
52-
"isSilentInstall":true
53-
}
54-
]
55-
}'
56-
57-
- name: Publish Submission
58-
uses: microsoft/store-submission@v1
59-
with:
60-
command: publish
46+
run: |-
47+
msstore-cli submission update ${{ secrets.PRODUCT_ID } '{
48+
"packages":[
49+
{
50+
"packageUrl":"${{ steps.releaseVars.outputs.powerToysInstallerX64Url }}",
51+
"languages":["zh-hans", "zh-hant", "en", "cs", "nl", "fr", "pt", "pt-br", "de", "hu", "it", "ja", "ko", "pl", "ru", "es", "tr"],
52+
"architectures":["X64"],
53+
"installerParameters":"/quiet /norestart",
54+
"isSilentInstall":true
55+
},
56+
{
57+
"packageUrl":"${{ steps.releaseVars.outputs.powerToysInstallerArm64Url }}",
58+
"languages":["zh-hans", "zh-hant", "en", "cs", "nl", "fr", "pt", "pt-br", "de", "hu", "it", "ja", "ko", "pl", "ru", "es", "tr"],
59+
"architectures":["Arm64"],
60+
"installerParameters":"/quiet /norestart",
61+
"isSilentInstall":true
62+
}
63+
]
64+
}'
65+
66+
# - name: Publish Submission
67+
# run: |-
68+
# msstore-cli submission publish ${{ secrets.PRODUCT_ID }}
69+
70+
- name: Clean up auth certificate
71+
if: always()
72+
run: |-
73+
rm -f cert.pfx

0 commit comments

Comments
 (0)