Skip to content

Commit

Permalink
ci: update ms store workflow
Browse files Browse the repository at this point in the history
Use manual script since GitHub actions seem abandoned.
  • Loading branch information
Merrit committed Apr 14, 2024
1 parent 30e5765 commit c73bf39
Showing 1 changed file with 41 additions and 10 deletions.
51 changes: 41 additions & 10 deletions .github/workflows/release-windows-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ concurrency:
group: ci-release-${{ github.ref }}-1
cancel-in-progress: true

env:
msix-filename-prefix: "FeelingFinder"

jobs:
call-build-windows:
uses: ./.github/workflows/build-windows.yml
Expand All @@ -28,14 +31,42 @@ jobs:
with:
path: artifacts

- name: Setup MSbuild
uses: microsoft/[email protected]

- name: Configure the Microsoft Store CLI
run: |
Install-Module -Name StoreBroker -Force
- name: Publish to Store
uses: isaacrlevin/windows-store-action@main
with:
tenant-id: ${{ secrets.AZURE_AD_TENANT_ID }}
client-id: ${{ secrets.AZURE_AD_APPLICATION_CLIENT_ID }}
client-secret: ${{ secrets.AZURE_AD_APPLICATION_SECRET }}
# "app-id" is the Store ID as listed in Partner Center
# https://github.com/isaacrlevin/windows-store-action/issues/5#issuecomment-1086893615
app-id: ${{ secrets.MICROSOFT_STORE_APP_ID }}
package-path: "${{ github.workspace }}/artifacts/windows-store-artifact/"
delete-pending: true
env:
CLIENT_ID: ${{ secrets.AZURE_AD_APPLICATION_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.AZURE_AD_APPLICATION_SECRET }}
run: |
# Login
$user = $Env:CLIENT_ID
$password = ConvertTo-SecureString $Env:CLIENT_SECRET -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential($user, $password)
Set-StoreBrokerAuthentication -TenantId ${{ secrets.AZURE_AD_TENANT_ID }} -Credential $Cred
$appId = ${{ secrets.MICROSOFT_STORE_APP_ID }}
# Get config json
New-StoreBrokerConfigFile -Path .\submission.json -AppId $appId
# Create submission package
# New-SubmissionPackage -ConfigPath .\submission.json -AppxPath .\Tonbrett.msix -OutPath out -OutName package
New-SubmissionPackage -ConfigPath .\submission.json -AppxPath .\artifacts\windows-store-artifact\${{ env.msix-filename-prefix }}-Windows-Store-Installer.msix -OutPath out -OutName package
# Create new submission
$sub = New-ApplicationSubmission -AppId $appId -Force
# Parse submission meta
$json = (Get-Content out\package.json -Encoding UTF8) | ConvertFrom-Json
# Delete old packages
foreach ($package in $sub.applicationPackages) {
$package.fileStatus = "PendingDelete"
}
# add new packages
$sub.applicationPackages += $json.applicationPackages
# Upload submission meta
Set-ApplicationSubmission -AppId $appId -UpdatedSubmission $sub
# Upload submission package
Set-SubmissionPackage -PackagePath out\package.zip -UploadUrl ($sub.fileUploadUrl)
# Commit changes
Complete-ApplicationSubmission -AppId $appId -SubmissionId ($sub.id)

0 comments on commit c73bf39

Please sign in to comment.