From e12867dd576d6360fa9ea74bef4d58c48a2c803f Mon Sep 17 00:00:00 2001 From: Alexander Holstrup <117829001+aholstrup1@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:02:37 +0200 Subject: [PATCH 1/3] Log telemetry for override scripts (#1277) --- Actions/RunPipeline/RunPipeline.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Actions/RunPipeline/RunPipeline.ps1 b/Actions/RunPipeline/RunPipeline.ps1 index fb0a42573..b7a1329e0 100644 --- a/Actions/RunPipeline/RunPipeline.ps1 +++ b/Actions/RunPipeline/RunPipeline.ps1 @@ -18,6 +18,7 @@ $projectPath = $null try { . (Join-Path -Path $PSScriptRoot -ChildPath "..\AL-Go-Helper.ps1" -Resolve) + Import-Module (Join-Path $PSScriptRoot '..\TelemetryHelper.psm1' -Resolve) DownloadAndImportBcContainerHelper if ($isWindows) { @@ -255,6 +256,8 @@ try { $scriptPath = Join-Path $ALGoFolderName "$ScriptName.ps1" if (Test-Path -Path $scriptPath -Type Leaf) { Write-Host "Add override for $scriptName" + Trace-Information -Message "Using override for $scriptName" + $runAlPipelineParams += @{ "$scriptName" = (Get-Command $scriptPath | Select-Object -ExpandProperty ScriptBlock) } From df9e7c1c11c02e7db70276ba31d22f668fd76acb Mon Sep 17 00:00:00 2001 From: Alexander Holstrup <117829001+aholstrup1@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:32:10 +0200 Subject: [PATCH 2/3] Write output of sign install to log (#1270) * Update the Sign script to log the output of dotnet install to the logs. * Update the sign package to latest. The Sign team recently made an improvement to write a warning if _Visual C++ Runtime_ is not installed. If it isn't, signing will fail because NavSip depends on this assembly. Related to #1252 --- Actions/Packages.json | 2 +- Actions/Sign/Sign.psm1 | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Actions/Packages.json b/Actions/Packages.json index 3eeff0daf..879db6674 100644 --- a/Actions/Packages.json +++ b/Actions/Packages.json @@ -1,5 +1,5 @@ { - "sign": "0.9.1-beta.24123.2", + "sign": "0.9.1-beta.24469.1", "Microsoft.ApplicationInsights": "2.20.0", "Az.Accounts": "2.15.1", "Az.Storage": "6.1.1", diff --git a/Actions/Sign/Sign.psm1 b/Actions/Sign/Sign.psm1 index f7207d5d2..3d8d9fce9 100644 --- a/Actions/Sign/Sign.psm1 +++ b/Actions/Sign/Sign.psm1 @@ -1,3 +1,15 @@ +<# + .SYNOPSIS + Checks whether nuget.org is added as a nuget source. +#> +function AssertNugetSourceIsAdded() { + $nugetSource = "https://api.nuget.org/v3/index.json" + $nugetSourceExists = dotnet nuget list source | Select-String -Pattern $nugetSource + if (-not $nugetSourceExists) { + throw "Nuget source $nugetSource is not added. Please add the source using 'dotnet nuget add source $nugetSource' or add another source with nuget.org as an upstream source." + } +} + <# .SYNOPSIS Installs the dotnet signing tool. @@ -16,10 +28,17 @@ function Install-SigningTool() { # Install the signing tool in the temp folder Write-Host "Installing signing tool version $version in $tempFolder" New-Item -ItemType Directory -Path $tempFolder | Out-Null - dotnet tool install sign --version $version --tool-path $tempFolder | Out-Null + dotnet tool install sign --version $version --tool-path $tempFolder | Out-Host # Return the path to the signing tool - $signingTool = Join-Path -Path $tempFolder "sign.exe" -Resolve + $signingTool = Join-Path -Path $tempFolder "sign.exe" + if (-not (Test-Path -Path $signingTool)) { + # Check if nuget.org is added as a nuget source + AssertNugetSourceIsAdded + + # If the tool is not found, throw an error + throw "Failed to install signing tool. If you are using a self-hosted runner please make sure you've followed all the steps described in https://aka.ms/algosettings#runs-on." + } return $signingTool } From a9088bdc4ad86599f20338d149dea81a0386c694 Mon Sep 17 00:00:00 2001 From: Freddy Kristiansen Date: Fri, 25 Oct 2024 16:32:49 +0200 Subject: [PATCH 3/3] add branches to delivertoappsource doc (#1266) Fixes #1216 --------- Co-authored-by: freddydk --- Scenarios/settings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scenarios/settings.md b/Scenarios/settings.md index 295c647f8..a048fcf18 100644 --- a/Scenarios/settings.md +++ b/Scenarios/settings.md @@ -43,7 +43,7 @@ When running a workflow or a local script, the settings are applied by reading s | Name | Description | Default value | | :-- | :-- | :-- | | appSourceCopMandatoryAffixes | This setting is only used if the type is AppSource App. The value is an array of affixes, which is used for running AppSource Cop. | \[ \] | -| deliverToAppSource | Structure with properties for AppSource delivery from AL-Go for GitHub. The structure can contain the following properties:
**productId** must be the product Id from partner Center.
**mainAppFolder** specifies the appFolder of the main app if you have multiple apps in the same project.
**continuousDelivery** can be set to true to enable continuous delivery of every successful build to AppSource Validation. Note that the app will only be in preview in AppSource and you will need to manually press GO LIVE in order for the app to be promoted to production.
**includeDependencies** can be set to an array of file names (incl. wildcards) which are the names of the dependencies to include in the AppSource submission. You need to set `generateDependencyArtifact` in the [project settings file](#where-are-the-settings-located) to true in order to include dependencies.
**Note:** You will need to define an AppSourceContext secret in order to publish to AppSource. | | +| deliverToAppSource | Structure with properties for AppSource delivery from AL-Go for GitHub. The structure can contain the following properties:
**branches** = an array of branch patterns, which are allowed to deliver to AppSource. (Default main)
**productId** must be the product Id from partner Center.
**mainAppFolder** specifies the appFolder of the main app if you have multiple apps in the same project.
**continuousDelivery** can be set to true to enable continuous delivery of every successful build to AppSource Validation. Note that the app will only be in preview in AppSource and you will need to manually press GO LIVE in order for the app to be promoted to production.
**includeDependencies** can be set to an array of file names (incl. wildcards) which are the names of the dependencies to include in the AppSource submission. You need to set `generateDependencyArtifact` in the [project settings file](#where-are-the-settings-located) to true in order to include dependencies.
**Note:** You will need to define an AppSourceContext secret in order to publish to AppSource. | | | obsoleteTagMinAllowedMajorMinor | This setting will enable AppSource cop rule AS0105, which causes objects that are pending obsoletion with an obsolete tag version lower than the minimum set in this property are not allowed. | | ## Basic Repository settings