-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use manual script since GitHub actions seem abandoned.
- Loading branch information
Showing
1 changed file
with
41 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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) |