From 619e1768e8cf1f1493b95a5efe58f0312c8bc20f Mon Sep 17 00:00:00 2001 From: "D. Sidiropoulos" Date: Thu, 4 Apr 2024 13:52:57 +0200 Subject: [PATCH] [build] fix (Laerdal.SetupBuildEnvironment.sh): fix the path to the artifacts folder so that it will be properly added to the nuget sources --- .github/workflows/github-compile.yml | 3 ++- Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh | 13 +++++++++---- azure-pipelines.yml | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/github-compile.yml b/.github/workflows/github-compile.yml index 54c5b974..200e6ea6 100644 --- a/.github/workflows/github-compile.yml +++ b/.github/workflows/github-compile.yml @@ -45,7 +45,8 @@ jobs: "$build_repository_folderpath/Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh" \ "https://nuget.pkg.github.com/Laerdal/index.json" \ "${{ secrets.scl_github_nuget_feed_username }}" \ - "${{ secrets.scl_github_access_token }}" + "${{ secrets.scl_github_access_token }}" \ + "$build_repository_folderpath/Artifacts" - name: '🏗 📦 Build, Pack & Announce New Release (if appropriate)' shell: bash diff --git a/Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh b/Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh index 46ee1133..b458c651 100644 --- a/Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh +++ b/Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh @@ -4,6 +4,8 @@ declare -r NUGET_FEED_URL="$1" declare -r NUGET_FEED_USERNAME="$2" declare -r NUGET_FEED_ACCESSTOKEN="$3" +declare -r ARTIFACTS_FOLDER_PATH="$4" + if [ -z "${NUGET_FEED_URL}" ]; then echo "##vso[task.logissue type=error]Missing 'NUGET_FEED_URL' which was expected to be parameter #1." exit 3 @@ -19,6 +21,11 @@ if [ -z "${NUGET_FEED_ACCESSTOKEN}" ]; then exit 6 fi +if [ -z "${ARTIFACTS_FOLDER_PATH}" ]; then + echo "##vso[task.logissue type=error]Missing 'ARTIFACTS_FOLDER_PATH' which was expected to be parameter #4." + exit 7 +fi + brew install --cask objectivesharpie declare exitCode=$? if [ $exitCode != 0 ]; then @@ -207,11 +214,9 @@ if [ $exitCode != 0 ]; then exit 170 fi -declare -r CurrentDirectory="$( dirname "$( readlink -f "${BASH_SOURCE[0]:-"$(command -v -- "$0")"}" )" )" - echo -echo "** Adding 'Artifacts' Folder as a Nuget Source:" -mkdir -p "${CurrentDirectory}/Artifacts" && dotnet nuget add source "${CurrentDirectory}/Artifacts" --name "LocalArtifacts" +echo "** Adding 'Artifacts' Folder as a Nuget Source (dotnet):" +mkdir -p "${ARTIFACTS_FOLDER_PATH}" && dotnet nuget add source "${ARTIFACTS_FOLDER_PATH}" --name "LocalArtifacts" declare exitCode=$? if [ $exitCode != 0 ]; then echo "##vso[task.logissue type=error]Failed to add 'Artifacts' folder as a nuget source." diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6a79969c..36db7887 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -78,13 +78,13 @@ jobs: inputs: targetType: filePath filePath: 'Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh' - arguments: ' "https://pkgs.dev.azure.com/LaerdalMedical/_packaging/LaerdalNuGet/nuget/v3/index.json" "$(Laerdal.NugetFeed.Username)" "$(Laerdal.NugetFeed.AccessToken)" ' + arguments: ' "https://pkgs.dev.azure.com/LaerdalMedical/_packaging/LaerdalNuGet/nuget/v3/index.json" "$(Laerdal.NugetFeed.Username)" "$(Laerdal.NugetFeed.AccessToken)" "$(Build.ArtifactStagingDirectory)/Artifacts/" ' # notice that explicitly disabling parallelization via m:1 below is vital because if parallelization is enabled the ios and android # builds will fail with cryptic errors due to multiple target-frameworks are involved coupled with the custom build logic for native libs # # also noticed that we intentionally skip the maccatalyst build on azure because under net8 we need macos14 to be available on azure but - # its not available just yet in 2024 Q1 :( + # it is not available just yet in 2024 Q1 :( - task: DotNetCoreCLI@2 displayName: '🏗 📦 Build, Pack & Announce New Release (if appropriate)' inputs: