Skip to content

Commit

Permalink
Merge pull request #443 from WildernessLabs/develop
Browse files Browse the repository at this point in the history
Merge to main to release CLI v2
  • Loading branch information
ctacke authored Feb 1, 2024
2 parents e59f7e1 + 4809d60 commit d90d702
Show file tree
Hide file tree
Showing 169 changed files with 5,515 additions and 5,715 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/dotnet-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Develop Build

on:
workflow_dispatch:
pull_request:
branches: [ develop ]
push:
branches: [ develop ]

jobs:
build:

runs-on: windows-latest

steps:
- name: Checkout Meadow.Logging
uses: actions/checkout@v3
with:
repository: WildernessLabs/Meadow.Logging
path: Meadow.Logging
ref: develop

- name: Checkout Meadow.Units
uses: actions/checkout@v3
with:
repository: WildernessLabs/Meadow.Units
path: Meadow.Units
ref: develop

- name: Checkout Meadow.Contracts
uses: actions/checkout@v3
with:
repository: WildernessLabs/Meadow.Contracts
path: Meadow.Contracts
ref: develop

- name: Checkout Meadow.CLI
uses: actions/checkout@v3
with:
path: Meadow.CLI

- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version:
8.0.x

- name: Build CLI v1
run: dotnet build -c Release Meadow.CLI/MeadowCLI.sln

- name: Build CLI v2
run: dotnet build -c Release Meadow.CLI/Source/v2/Meadow.CLI.v2.sln


268 changes: 132 additions & 136 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Meadow.CLI
name: Meadow.CLI Packaging
env:
CLI_RELEASE_VERSION: 1.5.0.0
IDE_TOOLS_RELEASE_VERSION: 1.5.0
Expand All @@ -7,13 +7,9 @@ env:
VS_MAC_2022_VERSION: 17.6

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

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
branches: [ main ]

jobs:
build-and-optionally-publish-nuget:
Expand Down Expand Up @@ -129,68 +125,68 @@ jobs:
# run: |
# nuget push main\Source\v2\Meadow.CLI\bin\Release\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}

build-vswin-2019:
runs-on: windows-2019
needs: [build-and-optionally-publish-nuget]
name: Build Win 2019 Extension

steps:
- name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/Meadow.CLI
path: Meadow.CLI

- if: ${{ github.ref == 'refs/heads/main' }}
name: Checkout Win Extension side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/VS_Win_Meadow_Extension
path: vs-win
ref: main

- if: ${{ github.ref != 'refs/heads/main' }}
name: Checkout Win Extension side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/VS_Win_Meadow_Extension
path: vs-win

- name: Setup .NET Core SDK 5.0.x, 6.0.x & 7.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
5.0.x
6.0.x
7.0.x
- name: Setup NuGet
uses: NuGet/[email protected]

- name: Add MSBuild to Path
uses: microsoft/[email protected]

- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Update VS2019 Version Numbers
run: |
$content = Get-Content vs-win/VS_Meadow_Extension/VS_Meadow_Extension.2019/source.extension.vsixmanifest | Out-String
$newcontent = $content -replace 'Version="1.*" Language="en-US" Publisher="Wilderness Labs"', 'Version="${{ ENV.IDE_TOOLS_RELEASE_VERSION }}" Language="en-US" Publisher="Wilderness Labs"'
$newcontent | Set-Content vs-win/VS_Meadow_Extension/VS_Meadow_Extension.2019/source.extension.vsixmanifest
- name: Restore VS2019 dependencies
run: dotnet restore vs-win/VS_Meadow_Extension.2019.sln /p:Configuration=Release

- name: Build VS2019 Extension
id: VS2019-Extension
run: msbuild vs-win/VS_Meadow_Extension.2019.sln /t:Rebuild /p:Configuration=Release
env:
DevEnvDir: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE'

- name: Upload VS2019 VSIX Artifacts
uses: actions/upload-artifact@v2
with:
name: Meadow.Win.VS2019.vsix.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
path: 'vs-win\VS_Meadow_Extension\VS_Meadow_Extension.2019\bin\Release\*.vsix'
# build-vswin-2019:
# runs-on: windows-2019
# needs: [build-and-optionally-publish-nuget]
# name: Build Win 2019 Extension

# steps:
# - name: Checkout Meadow.CLI.Core side-by-side
# uses: actions/checkout@v2
# with:
# repository: WildernessLabs/Meadow.CLI
# path: Meadow.CLI

# - if: ${{ github.ref == 'refs/heads/main' }}
# name: Checkout Win Extension side-by-side
# uses: actions/checkout@v2
# with:
# repository: WildernessLabs/VS_Win_Meadow_Extension
# path: vs-win
# ref: main

# - if: ${{ github.ref != 'refs/heads/main' }}
# name: Checkout Win Extension side-by-side
# uses: actions/checkout@v2
# with:
# repository: WildernessLabs/VS_Win_Meadow_Extension
# path: vs-win

# - name: Setup .NET Core SDK 5.0.x, 6.0.x & 7.0.x
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: |
# 5.0.x
# 6.0.x
# 7.0.x

# - name: Setup NuGet
# uses: NuGet/[email protected]

# - name: Add MSBuild to Path
# uses: microsoft/[email protected]

# - if: ${{ github.event_name == 'workflow_dispatch' }}
# name: Update VS2019 Version Numbers
# run: |
# $content = Get-Content vs-win/VS_Meadow_Extension/VS_Meadow_Extension.2019/source.extension.vsixmanifest | Out-String
# $newcontent = $content -replace 'Version="1.*" Language="en-US" Publisher="Wilderness Labs"', 'Version="${{ ENV.IDE_TOOLS_RELEASE_VERSION }}" Language="en-US" Publisher="Wilderness Labs"'
# $newcontent | Set-Content vs-win/VS_Meadow_Extension/VS_Meadow_Extension.2019/source.extension.vsixmanifest

# - name: Restore VS2019 dependencies
# run: dotnet restore vs-win/VS_Meadow_Extension.2019.sln /p:Configuration=Release

# - name: Build VS2019 Extension
# id: VS2019-Extension
# run: msbuild vs-win/VS_Meadow_Extension.2019.sln /t:Rebuild /p:Configuration=Release
# env:
# DevEnvDir: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE'

# - name: Upload VS2019 VSIX Artifacts
# uses: actions/upload-artifact@v2
# with:
# name: Meadow.Win.VS2019.vsix.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
# path: 'vs-win\VS_Meadow_Extension\VS_Meadow_Extension.2019\bin\Release\*.vsix'

#- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
# name: Publish VS2019 Extension
Expand Down Expand Up @@ -265,72 +261,72 @@ jobs:
run: |
& "${env:ProgramFiles}\Microsoft Visual Studio\2022\Enterprise\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe" publish -payload "vs-win\VS_Meadow_Extension\VS_Meadow_Extension.2022\bin\Release\Meadow.2022.vsix" -publishManifest "vs-win\publishManifest.2022.json" -ignoreWarnings "None" -personalAccessToken "${{secrets.MARKETPLACE_PUBLISH_PAT}}"
build-vsmac-2019:
name: Build Mac 2019 Extension
needs: [build-and-optionally-publish-nuget]
runs-on: macos-11

steps:
- name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v2
with:
path: Meadow.CLI

- if: ${{ github.ref == 'refs/heads/main' }}
name: Checkout Mac Extension side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/VS_Mac_Meadow_Extension
path: vs-mac
ref: main

- if: ${{ github.ref != 'refs/heads/main' }}
name: Checkout Mac Extension side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/VS_Mac_Meadow_Extension
path: vs-mac

- name: Set default Xcode 13.0
run: |
XCODE_ROOT=/Applications/Xcode_13.0.0.app
echo "MD_APPLE_SDK_ROOT=$XCODE_ROOT" >> $GITHUB_ENV
sudo xcode-select -s $XCODE_ROOT
- name: Setup .NET Core SDK 5.0.x, 6.0.x & 7.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
5.0.x
6.0.x
7.0.x
- name: Setup NuGet
uses: NuGet/[email protected]

- name: Work around so that VS2019 is picked up.
run: |
mv "/Applications/Visual Studio.app" "/Applications/Visual Studio 2022.app"
mv "/Applications/Visual Studio 2019.app" "/Applications/Visual Studio.app"
- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Update VS2019 Version Numbers
run: |
sed -i "" "s/Version = \"1.*\"/Version = \"${{ENV.IDE_TOOLS_RELEASE_VERSION}}\"/" vs-mac/VS4Mac_Meadow_Extension/Properties/AddinInfo.cs
- name: Restore our VS2019 project
run: |
msbuild vs-mac/VS4Mac_Meadow_Extension.sln /t:Restore /p:Configuration=Release
- name: Build and Package the VS2019 Extension
run: |
msbuild vs-mac/VS4Mac_Meadow_Extension.sln /t:Build /p:Configuration=Release /p:CreatePackage=true
- name: Upload Mac VS2019 mpack Artifacts
uses: actions/upload-artifact@v2
with:
name: Meadow.Mac.2019.mpack.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
path: 'vs-mac/VS4Mac_Meadow_Extension/bin/Release/net472/*.mpack'
# build-vsmac-2019:
# name: Build Mac 2019 Extension
# needs: [build-and-optionally-publish-nuget]
# runs-on: macos-11

# steps:
# - name: Checkout Meadow.CLI.Core side-by-side
# uses: actions/checkout@v2
# with:
# path: Meadow.CLI

# - if: ${{ github.ref == 'refs/heads/main' }}
# name: Checkout Mac Extension side-by-side
# uses: actions/checkout@v2
# with:
# repository: WildernessLabs/VS_Mac_Meadow_Extension
# path: vs-mac
# ref: main

# - if: ${{ github.ref != 'refs/heads/main' }}
# name: Checkout Mac Extension side-by-side
# uses: actions/checkout@v2
# with:
# repository: WildernessLabs/VS_Mac_Meadow_Extension
# path: vs-mac

# - name: Set default Xcode 13.0
# run: |
# XCODE_ROOT=/Applications/Xcode_13.0.0.app
# echo "MD_APPLE_SDK_ROOT=$XCODE_ROOT" >> $GITHUB_ENV
# sudo xcode-select -s $XCODE_ROOT

# - name: Setup .NET Core SDK 5.0.x, 6.0.x & 7.0.x
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: |
# 5.0.x
# 6.0.x
# 7.0.x

# - name: Setup NuGet
# uses: NuGet/[email protected]

# - name: Work around so that VS2019 is picked up.
# run: |
# mv "/Applications/Visual Studio.app" "/Applications/Visual Studio 2022.app"
# mv "/Applications/Visual Studio 2019.app" "/Applications/Visual Studio.app"

# - if: ${{ github.event_name == 'workflow_dispatch' }}
# name: Update VS2019 Version Numbers
# run: |
# sed -i "" "s/Version = \"1.*\"/Version = \"${{ENV.IDE_TOOLS_RELEASE_VERSION}}\"/" vs-mac/VS4Mac_Meadow_Extension/Properties/AddinInfo.cs

# - name: Restore our VS2019 project
# run: |
# msbuild vs-mac/VS4Mac_Meadow_Extension.sln /t:Restore /p:Configuration=Release

# - name: Build and Package the VS2019 Extension
# run: |
# msbuild vs-mac/VS4Mac_Meadow_Extension.sln /t:Build /p:Configuration=Release /p:CreatePackage=true

# - name: Upload Mac VS2019 mpack Artifacts
# uses: actions/upload-artifact@v2
# with:
# name: Meadow.Mac.2019.mpack.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
# path: 'vs-mac/VS4Mac_Meadow_Extension/bin/Release/net472/*.mpack'

#- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
# name: Get Commit Messages
Expand Down Expand Up @@ -592,4 +588,4 @@ jobs:
name: Publish VSCode Extension
run: |
cd vs-code
vsce publish -p ${{ secrets.MARKETPLACE_PUBLISH_PAT }}
vsce publish -p ${{ secrets.MARKETPLACE_PUBLISH_PAT }}
2 changes: 1 addition & 1 deletion Meadow.CLI.Core/Devices/MeadowDeviceHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public Task QspiInit(int value, CancellationToken cancellationToken = default)
return _meadowDevice.QspiInit(value, cancellationToken);
}

public async Task DeployApp(string fileName, bool includePdbs = true, CancellationToken cancellationToken = default, bool verbose = false, IList<string>? noLink = null)
public async Task DeployApp(string fileName, bool includePdbs = false, CancellationToken cancellationToken = default, bool verbose = false, IList<string>? noLink = null)
{
try
{
Expand Down
8 changes: 2 additions & 6 deletions Meadow.CLI.Core/Globals.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
#if VS2019
global using Meadow.CLI.Core.Logging;
#else
global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Logging.Abstractions;
#endif
global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Logging.Abstractions;
2 changes: 0 additions & 2 deletions Meadow.CLI.Core/Meadow.CLI.Core.VS2019.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
<PackageReference Include="YamlDotNet" Version="13.1.1" />
</ItemGroup>

<Import Project="..\MeadowLogger\MeadowLogger.projitems" Label="Shared" />

<ItemGroup>
<ProjectReference Include="..\Meadow.Hcom\Meadow.Hcom.csproj" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions Meadow.CLI.Core/lib/meadow_link.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
<assembly fullname="Meadow.Logging" />
<assembly fullname="SQLite-net" />
<assembly fullname="MQTTnet" />
<assembly fullname="System.Configuration" />
</linker>
2 changes: 1 addition & 1 deletion Meadow.CLI/Commands/App/DeployAppCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class DeployAppCommand : MeadowSerialCommand
public IList<string> NoLink { get; init; } = null;

[CommandOption("includePdbs", 'i', Description = "Include the PDB files on deploy to enable debugging", IsRequired = false)]
public bool IncludePdbs { get; init; } = true;
public bool IncludePdbs { get; init; } = false;

public DeployAppCommand(DownloadManager downloadManager, ILoggerFactory loggerFactory, MeadowDeviceManager meadowDeviceManager)
: base(downloadManager, loggerFactory, meadowDeviceManager)
Expand Down
Loading

0 comments on commit d90d702

Please sign in to comment.