Skip to content

Commit

Permalink
Merge pull request #92
Browse files Browse the repository at this point in the history
ksidirop/MAN-296-migrate-to-github-actions
  • Loading branch information
ksidirop-laerdal authored Mar 13, 2024
2 parents 2331117 + e774ba1 commit 3f88b7d
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 7 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
#
# https://docs.github.com/en/actions/migrating-to-github-actions/automated-migrations/migrating-from-azure-devops-with-github-actions-importer#environment-variable-mapping

name: Builder

env:
Build_Repository_LocalPath: ${{ github.workspace }}
Laerdal_Test_Results_Folderpath: '$Build_Repository_LocalPath/TestResults'

on:
push:
branches: [ "main", "develop" ]

pull_request:
branches: [ "main", "develop" ]

jobs:
build:

runs-on: macos-14

steps:

- uses: actions/checkout@v3

- name: Setup Build Environment
run: Laerdal.SetupBuildEnvironment.sh
shell: bash

- name: Add Artifacts folder as a local NuGet Source
run: nuget sources add -name "Artifacts" -source "$Build_Artifact_Staging_Directory/Artifacts"
shell: bash
env:
Build_Artifact_Staging_Directory: ${{ runner.temp }}

- name: Build .Net8+ Bindings and McuMgr itself and announce new release in GitHub (if needed)
shell: bash
run: |
dotnet \
msbuild \
Laerdal.McuMgr.Builder.targets \
-m:1 \
-p:ShouldSkipMacCatalyst="true" \
-p:PackageOutputPath="$Build_Artifact_Staging_Directory/Artifacts/" \
-p:Laerdal_Gradle_Path="/usr/local/opt/gradle@7/bin/gradle" \
-p:Laerdal_Source_Branch="$Source_Branch_Fullpath" \
-p:Laerdal_Repository_Path="$Github_Repository_Path" \
-p:Laerdal_Github_Access_Token="$Components_Team_Github_Access_Token" \
-p:Laerdal_Test_Results_Folderpath="$Laerdal_Test_Results_Folderpath"
env:
Source_Branch_Fullpath: ${{ GITHUB_REF }}
Github_Repository_Path: ${{ GITHUB_REPOSITORY }}
Components_Team_Github_Access_Token: ${{ secrets.COMPONENTS_TEAM_GITHUB_ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion Laerdal.McuMgr.Builder.targets
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<PropertyGroup>
<Newline>%0A</Newline>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<ShouldRunTestSuite Condition=" '$(ShouldRunTestSuite)' == '' " >true</ShouldRunTestSuite>
<ShouldRunTestSuite Condition=" '$(ShouldRunTestSuite)' == '' ">true</ShouldRunTestSuite>

<PackageOutputPath Condition=" '$(PackageOutputPath)' == '' ">$(BUILD_ARTIFACTSTAGINGDIRECTORY)</PackageOutputPath>
<PackageOutputPath Condition=" '$(PackageOutputPath)' == '' ">$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), `Artifacts/`))</PackageOutputPath>
Expand Down
1 change: 1 addition & 0 deletions Laerdal.McuMgr.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Misc", "_Misc", "{2459FC0F
Laerdal.Version.sh = Laerdal.Version.sh
global.json = global.json
Laerdal.SetupBuildEnvironment.sh = Laerdal.SetupBuildEnvironment.sh
.github\workflows\github-actions.yml = .github\workflows\github-actions.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Laerdal.McuMgr", "Laerdal.McuMgr\Laerdal.McuMgr.csproj", "{4E2952A5-394E-4184-8E12-F2D5342A43B2}"
Expand Down
12 changes: 6 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ jobs:
- script: 'mkdir "$(Build.ArtifactStagingDirectory)/Artifacts"'
displayName: 'Create Directory "$(Build.ArtifactStagingDirectory)/Artifacts"'

- task: NuGetCommand@2
displayName: 'NuGet Sources Add (for Classic Xamarin)'
inputs:
command: 'custom'
arguments: ' sources Add -Name LocalNugets -Source "$(Build.ArtifactStagingDirectory)/Artifacts" '
# - task: NuGetCommand@2
# displayName: 'NuGet Sources Add (for Classic Xamarin)'
# inputs:
# command: 'custom'
# arguments: ' sources Add -Name LocalNugets -Source "$(Build.ArtifactStagingDirectory)/Artifacts" '

- task: DotNetCoreCLI@2
displayName: 'NuGet Sources Add (for .Net8+)'
inputs:
custom: 'nuget'
command: 'custom'
arguments: ' add source "$(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
#
Expand Down

0 comments on commit 3f88b7d

Please sign in to comment.