Skip to content

perf (iOS/all operations): we now launch logging and progress% callba… #365

perf (iOS/all operations): we now launch logging and progress% callba…

perf (iOS/all operations): we now launch logging and progress% callba… #365

Workflow file for this run

#
# https://docs.github.com/en/actions/migrating-to-github-actions/automated-migrations/migrating-from-azure-devops-with-github-actions-importer#environment-variable-mapping
#
name: '🏗 📦 Build, Pack & Deploy Nugets'
env:
BUILD_REPOSITORY_FOLDERPATH: ${{ github.workspace }}
LAERDAL_SOURCE_BRANCH: ${{ github.ref }}
LAERDAL_REPOSITORY_PATH: ${{ github.repository }}
# note that we prefer to use our own token here instead of GITHUB_TOKEN that is because if we
# ever need access to other nuget repos of Laerdal they will be inaccessible to the GITHUB_TOKEN
SCL_GITHUB_ACCESS_TOKEN: ${{ secrets.SCL_GITHUB_ACCESS_TOKEN }}
SCL_NUGET_ORG_FEED_API_KEY: ${{ secrets.NUGET_ORG_FEED_API_KEY }}
SCL_GITHUB_NUGET_FEED_USERNAME: ${{ secrets.SCL_GITHUB_NUGET_FEED_USERNAME }}
SCL_DEPENDENCY_TRACKER_API_KEY: ${{ secrets.SCL_DEPENDENCY_TRACKER_API_KEY }}
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.405" # dont upgrade this lightheartedly the workload snapshot implicitly defines which versions of Android/iOS/MacCatalyst SDKs are supported
BINDINGS_ANDROID___DOTNET_TARGET_PLATFORM_VERSION: "34" # for the csproj file
BINDINGS_IOS___SDK_VERSION: "18.1" # for xcodebuild
BINDINGS_IOS___XCODE_IDE_DEV_PATH: "/Applications/Xcode_16.1.app/Contents/Developer" # for xcodebuild
BINDINGS_IOS___DOTNET_TARGET_PLATFORM_VERSION: "18.0" # for the csproj file
BINDINGS_MACCATALYST___SDK_VERSION: "15.1" # for xcodebuild
BINDINGS_MACCATALYST___XCODE_IDE_DEV_PATH: "/Applications/Xcode_16.1.app/Contents/Developer" # for xcodebuild
BINDINGS_MACCATALYST___DOTNET_TARGET_PLATFORM_VERSION: "18.0" # for the csproj file
on:
workflow_call: # so that other workflows can trigger this
workflow_dispatch: # allows to run this workflow manually from the actions tab
push:
branches:
- '**' # '*' matches zero or more characters but does not match the `/` character '**' matches zero or more of any character
pull_request: # we need to build on pull requests so that we can generate and upload the sbom before merging onto main/develop branches
branches:
- '**'
jobs:
build:
runs-on: 'macos-15' # need a macos image that supports xcode 16.1+
# variable substitution is not supported in github at all so we cant do stuff like this
#
# env:
# Build_Artifacts_Folderpath: ${{env.BUILD_REPOSITORY_FOLDERPATH}}/Artifacts
steps:
- name: '🔽 Checkout'
uses: 'actions/checkout@v4'
with:
fetch-tags: true # https://github.com/actions/checkout/issues/1471#issuecomment-1771231294
fetch-depth: 0
- name: '🛠 Setup Build Environment'
shell: 'bash'
run: |
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" \
"${{env.SCL_GITHUB_NUGET_FEED_USERNAME}}" \
"${{env.SCL_GITHUB_ACCESS_TOKEN}}" \
"${{env.BUILD_REPOSITORY_FOLDERPATH}}/Artifacts"
- name: '🏗 📦 Build, Pack & Announce New Release (if appropriate)'
shell: 'bash'
run: |
cd "${{env.BUILD_REPOSITORY_FOLDERPATH}}/Laerdal.Scripts" \
&& \
echo "${{env.SCL_DEPENDENCY_TRACKER_API_KEY}}" > "./dependency_tracker_api_key.ppk" \
&& \
echo "${{env.SCL_DEPENDENCY_TRACKER_SIGNING_PRIVATE_KEY}}" > "./dependency_tracker_private_signing_key.ppk" \
&& \
dotnet \
msbuild \
"Laerdal.Builder.targets" \
-m:1 \
-p:Should_Skip_MacCatalyst="false" \
\
-p:PackageOutputPath="${{env.BUILD_REPOSITORY_FOLDERPATH}}/Artifacts" \
\
-p:Laerdal_Gradle_Path="/opt/homebrew/opt/gradle@7/bin/gradle" \
-p:Laerdal_Source_Branch="${{env.LAERDAL_SOURCE_BRANCH}}" \
-p:Laerdal_Repository_Path="${{env.LAERDAL_REPOSITORY_PATH}}" \
-p:Laerdal_Github_Access_Token="${{env.SCL_GITHUB_ACCESS_TOKEN}}" \
-p:Laerdal_Test_Results_Folderpath="${{env.BUILD_REPOSITORY_FOLDERPATH}}/TestResults" \
\
-p:Laerdal_Bindings_Android___DotnetTargetPlatformVersion="${{env.BINDINGS_ANDROID___DOTNET_TARGET_PLATFORM_VERSION}}" \
\
-p:Laerdal_Bindings_iOS___Sdk_Version="${{env.BINDINGS_IOS___SDK_VERSION}}" \
-p:Laerdal_Bindings_iOS___Xcode_Ide_Dev_Path="${{env.BINDINGS_IOS___XCODE_IDE_DEV_PATH}}" \
-p:Laerdal_Bindings_iOS___DotnetTargetPlatformVersion="${{env.BINDINGS_IOS___DOTNET_TARGET_PLATFORM_VERSION}}" \
\
-p:Laerdal_Bindings_MacCatalyst___Sdk_Version="${{env.BINDINGS_MACCATALYST___SDK_VERSION}}" \
-p:Laerdal_Bindings_MacCatalyst___Xcode_Ide_Dev_Path="${{env.BINDINGS_MACCATALYST___XCODE_IDE_DEV_PATH}}" \
-p:Laerdal_Bindings_MacCatalyst___DotnetTargetPlatformVersion="${{env.BINDINGS_MACCATALYST___DOTNET_TARGET_PLATFORM_VERSION}}" \
\
-p:Laerdal_Dependency_Tracker_Server_Url="${{env.SCL_DEPENDENCY_TRACKER_SERVER_URL}}" \
-p:Laerdal_Dependency_Tracker_Api_Key_File_Path="${{env.BUILD_REPOSITORY_FOLDERPATH}}/Laerdal.Scripts/dependency_tracker_api_key.ppk" \
-p:Laerdal_Dependency_Tracker_Private_Signing_Key_File_Path="${{env.BUILD_REPOSITORY_FOLDERPATH}}/Laerdal.Scripts/dependency_tracker_private_signing_key.ppk" \
&& \
rm "./dependency_tracker_private_signing_key.ppk" "./dependency_tracker_api_key.ppk"
- name: '📡 Publish Test Results' # https://github.com/marketplace/actions/publish-test-results
uses: 'EnricoMi/publish-unit-test-result-action/macos@v2'
if: always() # this means: "run even if prior steps fail" if tests fail, the build will fail, but at least we will know exactly what failed
with:
files: |
TestResults/**/TEST-*.xml
TestResults/**/TEST-*.trx
- name: '⬆️ Upload Artifacts' # to share with other workflows https://stackoverflow.com/a/77663335/863651
uses: 'actions/upload-artifact@v4'
with:
name: 'Artifacts'
path: '${{env.BUILD_REPOSITORY_FOLDERPATH}}/Artifacts/**/*'
- name: '🚀 Publish Nugets over to Nuget.org'
shell: 'bash'
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
run: |
cd "${{env.BUILD_REPOSITORY_FOLDERPATH}}/Artifacts/" \
&& \
ls . \
&& \
dotnet \
nuget \
push \
--source "https://api.nuget.org/v3/index.json" \
--api-key "${{env.SCL_NUGET_ORG_FEED_API_KEY}}" \
*.nupkg
# we no longer publish our nugets to the github feed considering that we are already publishing them to nuget.org right above
#
# - name: '🚀 Publish Nugets over to the Laerdal Nuget Server on Github' # https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry
# shell: 'bash'
# if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
# run: |
# cd "${{env.BUILD_REPOSITORY_FOLDERPATH}}/Artifacts/" \
# && \
# ls . \
# && \
# dotnet \
# nuget \
# push \
# --source "https://nuget.pkg.github.com/Laerdal/index.json" \
# --api-key "${{env.SCL_GITHUB_ACCESS_TOKEN}}" \
# *nupkg