-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
develop
- Loading branch information
Showing
10 changed files
with
915 additions
and
87 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# | ||
# https://docs.github.com/en/actions/migrating-to-github-actions/automated-migrations/migrating-from-azure-devops-with-github-actions-importer#environment-variable-mapping | ||
# | ||
# bare in mind that variable substitution is not supported in github at all so we cant do stuff like this | ||
# | ||
# env: | ||
# Build_Artifacts_Folderpath: $build_repository_folderpath/Artifacts | ||
# | ||
|
||
name: '🏗 📦 Build, Pack & Deploy Nugets' | ||
|
||
env: | ||
BUILD_REPOSITORY_FOLDERPATH: ${{ github.workspace }} | ||
|
||
LAERDAL_SOURCE_BRANCH: ${{ github.ref }} | ||
LAERDAL_REPOSITORY_PATH: ${{ github.repository }} | ||
|
||
SCL_GITHUB_ACCESS_TOKEN: ${{ secrets.SCL_GITHUB_ACCESS_TOKEN }} | ||
SCL_NUGET_ORG_FEED_API_KEY: ${{ secrets.NUGET_ORG_FEED_API_KEY }} | ||
SCL_AZURE_ARTIFACTS_API_KEY: ${{ secrets.SCL_AZURE_ARTIFACTS_API_KEY }} | ||
SCL_GITHUB_NUGET_FEED_USERNAME: ${{ secrets.SCL_GITHUB_NUGET_FEED_USERNAME }} | ||
|
||
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: | ||
branches: | ||
- '**' | ||
|
||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: 'windows-2022' | ||
timeout-minutes: 5 | ||
|
||
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" \ | ||
"https://nuget.pkg.github.com/Laerdal/index.json" \ | ||
"${{ env.SCL_GITHUB_NUGET_FEED_USERNAME }}" \ | ||
"${{ env.SCL_GITHUB_ACCESS_TOKEN }}" \ | ||
"${{ env.BUILD_REPOSITORY_FOLDERPATH }}/Artifacts" | ||
# we need to manually install java11 because it is needed by the latest windows vm-images that run on | ||
# msbuild version 17.8.3 that started rolling out around 20 Nov 2023 https://stackoverflow.com/a/77519085/863651 | ||
- name: '🛠 Set Up JDK 11' | ||
uses: 'actions/setup-java@v2' | ||
with: | ||
java-version: '11' | ||
architecture: 'x64' | ||
distribution: 'adopt' | ||
|
||
- name: '🏗 📦 Build, Pack & Announce New Release (if appropriate)' | ||
shell: 'bash' | ||
run: | | ||
cd "${{env.BUILD_REPOSITORY_FOLDERPATH}}/Laerdal.Scripts" \ | ||
&& \ | ||
dotnet \ | ||
msbuild \ | ||
"Laerdal.Builder.targets" \ | ||
\ | ||
-p:PackageOutputPath="${{ env.BUILD_REPOSITORY_FOLDERPATH }}/Artifacts" \ | ||
-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 }}" | ||
- 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/**/*' | ||
if-no-files-found: error | ||
|
||
- name: '🚀 Publish 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 | ||
- name: '🚀 Publish to the 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.002.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Laerdal.Dfu", "Laerdal.Dfu\Laerdal.Dfu.csproj", "{A837B5B9-0B0C-48F6-A342-4060EC71E2C9}" | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Laerdal.Dfu", "Laerdal.Dfu\Laerdal.Dfu.csproj", "{0A938850-09F9-44A5-825F-84C932074A29}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Misc", "_Misc", "{37EBD209-B465-4483-B6A9-46EAC9FE20EF}" | ||
ProjectSection(SolutionItems) = preProject | ||
README.md = README.md | ||
LICENSE = LICENSE | ||
Laerdal.Scripts\Laerdal.Version.sh = Laerdal.Scripts\Laerdal.Version.sh | ||
Laerdal.Scripts\Laerdal.Builder.targets = Laerdal.Scripts\Laerdal.Builder.targets | ||
Laerdal.Scripts\Laerdal.Changelog.sh = Laerdal.Scripts\Laerdal.Changelog.sh | ||
Laerdal.Scripts\Laerdal.CreateNewReleaseInGithub.sh = Laerdal.Scripts\Laerdal.CreateNewReleaseInGithub.sh | ||
Laerdal.Scripts\Laerdal.SetupBuildEnvironment.sh = Laerdal.Scripts\Laerdal.SetupBuildEnvironment.sh | ||
.github\workflows\github-actions.yml = .github\workflows\github-actions.yml | ||
EndProjectSection | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{A837B5B9-0B0C-48F6-A342-4060EC71E2C9}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{A837B5B9-0B0C-48F6-A342-4060EC71E2C9}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {5DFF87D5-25C1-4291-A72E-EAD4129E1981} | ||
{0A938850-09F9-44A5-825F-84C932074A29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{0A938850-09F9-44A5-825F-84C932074A29}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{0A938850-09F9-44A5-825F-84C932074A29}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{0A938850-09F9-44A5-825F-84C932074A29}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,37 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net7.0-ios;net7.0-android</TargetFrameworks> | ||
<UseMaui>true</UseMaui> | ||
<SingleProject>true</SingleProject> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
|
||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion> | ||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<TargetFrameworks>net7.0-ios;net7.0-android</TargetFrameworks> | ||
<UseMaui>true</UseMaui> | ||
<SingleProject>true</SingleProject> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
|
||
<PropertyGroup> | ||
<Laerdal_Package_Name>Laerdal.Dfu</Laerdal_Package_Name> | ||
<Laerdal_Package_Tags>Ble;Tools;Dfu;Bluetooth;Nordic;Semiconductor</Laerdal_Package_Tags> | ||
<Laerdal_Package_Copyright>Laerdal Medical, Francois Raminosona</Laerdal_Package_Copyright> | ||
<Laerdal_Package_Description>Wrapper around Nordic.Dfu</Laerdal_Package_Description> | ||
</PropertyGroup> | ||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion> | ||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion> | ||
</PropertyGroup> | ||
|
||
<!-- ==================== VERSION ==================== --> | ||
<PropertyGroup> | ||
<Laerdal_Version_Major>1</Laerdal_Version_Major> | ||
<Laerdal_Version_Minor>27</Laerdal_Version_Minor> | ||
<Laerdal_Version_Build Condition="'$(BUILD_BUILDID)' != ''">$(BUILD_BUILDID)</Laerdal_Version_Build> <!-- Azure DevOps, Last build was 43857 --> | ||
<Laerdal_Version_Build Condition="'$(GITHUB_RUN_NUMBER)' != ''">$([MSBuild]::Add(8, $(GITHUB_RUN_NUMBER)))</Laerdal_Version_Build> <!-- GitHub Actions, auto-increment from 0 --> | ||
<Laerdal_Version_Build Condition="'$(CI_PIPELINE_IID)' != ''">$([MSBuild]::Add(8, $(CI_PIPELINE_IID)))</Laerdal_Version_Build> <!-- GitLab, auto-increment from 0 --> | ||
<Laerdal_Version_Build Condition="'$(Laerdal_Version_Build)' == ''">0</Laerdal_Version_Build> <!-- Fallback value --> | ||
<PropertyGroup> | ||
<Laerdal_Package_Name>Laerdal.Dfu</Laerdal_Package_Name> | ||
<Laerdal_Package_Tags>Ble;Tools;Dfu;Bluetooth;Nordic;Semiconductor</Laerdal_Package_Tags> | ||
<Laerdal_Package_Copyright>Laerdal Medical, Francois Raminosona</Laerdal_Package_Copyright> | ||
<Laerdal_Package_Description>Wrapper around Nordic.Dfu</Laerdal_Package_Description> | ||
</PropertyGroup> | ||
|
||
<Laerdal_Version Condition="'$(Laerdal_Version)' == ''">$(Laerdal_Version_Major).$(Laerdal_Version_Minor).$(Laerdal_Version_Build)</Laerdal_Version> | ||
</PropertyGroup> | ||
<!-- ==================== VERSION ==================== --> | ||
<PropertyGroup> | ||
<Laerdal_Version_Major Condition=" '$(Laerdal_Version_Major)' == '' ">1</Laerdal_Version_Major> | ||
<Laerdal_Version_Minor Condition=" '$(Laerdal_Version_Minor)' == '' ">27</Laerdal_Version_Minor> | ||
<Laerdal_Version_Build Condition=" '$(Laerdal_Version_Build)' == '' ">0</Laerdal_Version_Build> | ||
|
||
<Import Project="Laerdal.targets" /> | ||
<Laerdal_Version Condition=" '$(Laerdal_Version)' == '' ">$(Laerdal_Version_Major).$(Laerdal_Version_Minor).$(Laerdal_Version_Build)</Laerdal_Version> | ||
</PropertyGroup> | ||
|
||
<Import Project="Laerdal.targets"/> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-android'"> | ||
<PackageReference Include="Laerdal.Dfu.Bindings.Android" Version="2.3.0.43685" /> | ||
<PackageReference Include="Laerdal.Dfu.Bindings.Android" Version="2.3.0.43685"/> | ||
</ItemGroup> | ||
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-ios'"> | ||
<PackageReference Include="Laerdal.Dfu.Bindings.iOS" Version="4.13.0.43870" /> | ||
<PackageReference Include="Laerdal.Dfu.Bindings.iOS" Version="4.13.0.43870"/> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.