From 7a66ed6da4e6ec3a2626e4b619955820e37cfcf2 Mon Sep 17 00:00:00 2001 From: Freddy Kristiansen Date: Tue, 25 Jun 2024 15:12:20 +0200 Subject: [PATCH] Issue 1073 (#1118) Fail delivery if New-AppSourceSubmission fails. Fixes #1073 Co-authored-by: freddydk --- Actions/Deliver/Deliver.ps1 | 5 ++++- RELEASENOTES.md | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Actions/Deliver/Deliver.ps1 b/Actions/Deliver/Deliver.ps1 index 760141a5d..65389e999 100644 --- a/Actions/Deliver/Deliver.ps1 +++ b/Actions/Deliver/Deliver.ps1 @@ -482,7 +482,10 @@ try { throw "Unable to locate main app file ($mainAppFileName doesn't exist)" } Write-Host "Submitting to AppSource" - New-AppSourceSubmission -authContext $authContext -productId $projectSettings.deliverToAppSource.productId -appFile $appFile -libraryAppFiles $libraryAppFiles -doNotWait -autoPromote:$goLive -Force + $status = New-AppSourceSubmission -authContext $authContext -productId $projectSettings.deliverToAppSource.productId -appFile $appFile -libraryAppFiles $libraryAppFiles -doNotWait -autoPromote:$goLive -Force + if ($status.state -ne 'Published' -or ($status.substate -ne 'ReadyToPublish' -and $status.substate -ne 'InStore')) { + throw "AppSource submission failed. Status is $($status.state/$status.substate)" + } } } else { diff --git a/RELEASENOTES.md b/RELEASENOTES.md index f9d5ea87a..8080f9ce2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,6 +1,7 @@ ### Issues - Issue 1105 Increment Version Number - repoVersion in .github/AL-Go-Settings.json is not updated +- Issue 1073 Publish to AppSource - Automated validation: failure ### Business Central Performance Toolkit Test Result Viewer