Skip to content

Commit

Permalink
[build] fix (Laerdal.SetupBuildEnvironment.sh): fix the path to the a…
Browse files Browse the repository at this point in the history
…rtifacts folder so that it will be properly added to the nuget sources
  • Loading branch information
dsidirop committed Apr 4, 2024
1 parent 328fab1 commit 619e176
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/github-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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."
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 619e176

Please sign in to comment.