Skip to content

Commit

Permalink
feat (github-actions.yml): pin workloads to version 8.0.402
Browse files Browse the repository at this point in the history
  • Loading branch information
ksidirop-laerdal committed Nov 8, 2024
1 parent 75a777b commit 90f91a4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ env:
SCL_DEPENDENCY_TRACKER_SERVER_URL: ${{ secrets.SCL_DEPENDENCY_TRACKER_SERVER_URL }}
SCL_DEPENDENCY_TRACKER_SIGNING_PRIVATE_KEY: ${{ secrets.SCL_DEPENDENCY_TRACKER_SIGNING_PRIVATE_KEY }}

DOTNET_TARGET_WORKLOAD_VERSION: "8.0.402" # dont upgrade this lightheartedly the workload snapshot implicitly defines which versions of Android/iOS/MacCatalyst SDKs are supported


on:
workflow_call: # so that other workflows can trigger this
Expand Down Expand Up @@ -60,6 +62,7 @@ jobs:
chmod +x "${{env.BUILD_REPOSITORY_FOLDERPATH}}/Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh" \
&& \
"${{env.BUILD_REPOSITORY_FOLDERPATH}}/Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh" \
"${{env.DOTNET_TARGET_WORKLOAD_VERSION}}" \
"https://nuget.pkg.github.com/Laerdal/index.json" \
"${{ github.actor }}" \
"${{ github.token }}" \
Expand Down
34 changes: 19 additions & 15 deletions Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,37 @@

# windows-2022 vmimages in azure have dotnet 8.0.100 preinstalled so we should be fine

declare -r DOTNET_TARGET_WORKLOAD_VERSION="$1"

declare -r NUGET_FEED_URL="$1"
declare -r NUGET_FEED_USERNAME="$2"
declare -r NUGET_FEED_ACCESSTOKEN="$3"
declare -r NUGET_FEED_URL="$2"
declare -r NUGET_FEED_USERNAME="$3"
declare -r NUGET_FEED_ACCESSTOKEN="$4"

declare -r ARTIFACTS_FOLDER_PATH="$4"
declare -r ARTIFACTS_FOLDER_PATH="$5"

if [ -z "${DOTNET_TARGET_WORKLOAD_VERSION}" ]; then
echo "##vso[task.logissue type=error]Missing 'DOTNET_TARGET_WORKLOAD_VERSION' which was expected to be parameter #1."
exit 1
fi

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
echo "##vso[task.logissue type=error]Missing 'NUGET_FEED_URL' which was expected to be parameter #2."
exit 2
fi

if [ -z "${NUGET_FEED_USERNAME}" ]; then
echo "##vso[task.logissue type=error]Missing 'NUGET_FEED_USERNAME' which was expected to be parameter #2."
exit 5
echo "##vso[task.logissue type=error]Missing 'NUGET_FEED_USERNAME' which was expected to be parameter #3."
exit 3
fi

if [ -z "${NUGET_FEED_ACCESSTOKEN}" ]; then
echo "##vso[task.logissue type=error]Missing 'NUGET_FEED_ACCESSTOKEN' which was expected to be parameter #3."
exit 6
echo "##vso[task.logissue type=error]Missing 'NUGET_FEED_ACCESSTOKEN' which was expected to be parameter #4."
exit 4
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
echo "##vso[task.logissue type=error]Missing 'ARTIFACTS_FOLDER_PATH' which was expected to be parameter #5."
exit 5
fi


Expand Down Expand Up @@ -64,16 +70,14 @@ if [ $exitCode != 0 ]; then
exit 30
fi

# declare dotnet_8_workload_version="8.0.3"
dotnet \
workload \
install \
maui \
ios \
android \
maui-ios \
maui-android
# --from-rollback-file=https://maui.blob.core.windows.net/metadata/rollbacks/${dotnet_8_workload_version}.json # we need to install additional packages manually
maui-android --version "${DOTNET_TARGET_WORKLOAD_VERSION}"
declare exitCode=$?
if [ $exitCode != 0 ]; then
echo "##vso[task.logissue type=error]Failed to restore dotnet workloads."
Expand Down

0 comments on commit 90f91a4

Please sign in to comment.