diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6244a8b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,61 @@ +# Build SampleIntegration.sln and DynamoSamples.sln with .NET 8.0 +name: Build + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout DynamoSamples Repo + uses: actions/checkout@v4 + with: + path: DynamoSamples + repository: DynamoDS/DynamoSamples + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + - name: Disable problem matcher + run: echo "::remove-matcher owner=csc::" + - name: Setup msbuild + uses: microsoft/setup-msbuild@v1.3 + - name: Install dependencies for SampleIntegration + run: | + dotnet restore ${{ github.workspace }}\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release --runtime=win-x64 + - name: Build SampleIntegration + run: | + msbuild ${{ github.workspace }}\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release + - name: Look for Sample Integration + run: | + if (Test-Path -Path "${{ github.workspace }}\DynamoSamples\src\SampleIntegration\bin\Release\SampleIntegration.dll") { + Write-Output "SampleIntegration.dll exists!" + } else { + Write-Error "SampleIntegration.dll was not found!" + } + - name: Install dependencies for DynamoSamples + run: | + dotnet restore ${{ github.workspace }}\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release --runtime=win-x64 + - name: Build DynamoSamples + run: | + msbuild ${{ github.workspace }}\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release + - name: Look for Sample Packages + run: | + $paths = @( + "${{ github.workspace }}\DynamoSamples\dynamo_linter\Sample Linter\bin\SampleLinter.dll", + "${{ github.workspace }}\DynamoSamples\dynamo_package\Dynamo Samples\bin\SampleLibraryUI.dll", + "${{ github.workspace }}\DynamoSamples\dynamo_package\Dynamo Samples\bin\SampleLibraryZeroTouch.dll", + "${{ github.workspace }}\DynamoSamples\dynamo_viewExtension\Sample View Extension\bin\SampleViewExtension.dll" + ) + + foreach ($path in $paths) { + if (Test-Path -Path $path) { + Write-Output "$path exists!" + } else { + Write-Error "$path was not found!" + } + } diff --git a/.github/workflows/build_dynamo_samples_net8.0.yml b/.github/workflows/build_dynamo_samples_net8.0.yml deleted file mode 100644 index 1d35049..0000000 --- a/.github/workflows/build_dynamo_samples_net8.0.yml +++ /dev/null @@ -1,62 +0,0 @@ -# Build DynamoAll.sln with .NET 8.0 -name: Build DynamoSamples.sln net8.0 - -on: - push: - branches: - - master - pull_request: - -jobs: - build: - runs-on: windows-latest - steps: - - name: Checkout DynamoSamples Repo - uses: actions/checkout@v4 - with: - path: DynamoSamples - repository: DynamoDS/DynamoSamples - - name: Setup dotnet - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.0.x' - - name: Disable problem matcher - run: echo "::remove-matcher owner=csc::" - - name: Install dependencies for SampleIntegration - run: | - dotnet restore $Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release --runtime=win-x64 - - name: Build SampleIntegration with MSBuild for Windows - run: | - echo "***Continue with the build, Good luck developer!***" - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\" - .\MSBuild.exe $Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release - # look for DynamoSamples outputs - - name: Navigate to SampleIntegration Folder - run: | - cd "$Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleIntegration\bin\Release" - echo "***Locating SampleIntegration.dll for Windows!***" - test ".\SampleIntegration.dll" && echo "SampleIntegration.dll exists!" - - name: Install dependencies for windows runtime - run: | - dotnet restore $Env:GITHUB_WORKSPACE\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release --runtime=win-x64 - - name: Build DynamoSamples with MSBuild for Windows - run: | - echo "***Continue with the build, Good luck developer!***" - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\" - .\MSBuild.exe $Env:GITHUB_WORKSPACE\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release - # look for DynamoSamples outputs - - name: Navigate to dynamo_linter Folder - run: | - cd "$Env:GITHUB_WORKSPACE\DynamoSamples\dynamo_linter\Sample Linter\bin" - echo "***Locating SampleLinter.dll for Windows!***" - test ".\SampleLinter.dll" && echo "SampleLinter.dll exists!" - - name: Navigate to dynamo_package Folder - run: | - cd "$Env:GITHUB_WORKSPACE\DynamoSamples\dynamo_package\Dynamo Samples\bin" - echo "***Locating dynamo_package dlls for Windows!***" - test ".\SampleLibraryUI.dll" && echo "SampleLibraryUI.dll exists!" && test ".\SampleLibraryZeroTouch.dll" && echo "SampleLibraryZeroTouch.dll exists!" - - name: Navigate to dynamo_viewExtension Folder - run: | - cd "$Env:GITHUB_WORKSPACE\DynamoSamples\dynamo_viewExtension\Sample View Extension\bin" - echo "***Locating SampleViewExtension.dll for Windows!***" - test ".\SampleViewExtension.dll" && echo "SampleViewExtension.dll exists!" diff --git a/LICENSE b/LICENSE index 20efd1b..fb69acf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 +Copyright (c) 2024 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/README.md b/README.md index 716f7e8..53050cc 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,25 @@ -[![Build status](https://ci.appveyor.com/api/projects/status/qjdj92r86xb2tbq3?svg=true)](https://ci.appveyor.com/project/ikeough/dynamosamples) +[![Build](https://github.com/DynamoDS/DynamoSamples/actions/workflows/build.yml/badge.svg)](https://github.com/DynamoDS/DynamoSamples/actions/workflows/build.yml) ![Image](https://raw.github.com/ikeough/Dynamo/master/doc/distrib/Images/dynamo_logo_dark.png) # Dynamo Samples + A collection of samples demonstrating how to develop libraries for Dynamo. -These samples make use of the [Dynamo NuGet packages](https://www.nuget.org/packages?q=DynamoVisualProgramming). NuGet should take care of restoring these packages if they are not available on your system at build time. +These samples make use of the [Dynamo NuGet packages](https://www.nuget.org/packages?q=DynamoVisualProgramming). NuGet should take care of restoring these packages if they are not available on your system at build time. # Building the Samples ## Requirements + - Visual Studio 2019 - .NET Framework 4.8 ## Instructions + - Clone the repository. - Choose a branch: - - The master branch of Dynamo Samples corresponds to the master branch of Dynamo. To build against a specific version, choose that version's branch. I.e. 0.8.0, 0.9.0, etc. + - The master branch of Dynamo Samples corresponds to the master branch of Dynamo. To build against a specific version, choose that version's branch. i.e. 0.8.0, 0.9.0, etc. - Open `DynamoSamples.sln` with Visual Studio. - Build using the `Debug/Any CPU` configuration. - The `dynamo_package` folder at the root of the repository will now have the built libraries. The `Dynamo Samples` folder in that directory can be copied directly to your Dynamo packages directory:`C:\Users\\AppData\Roaming\Dynamo Core\\packages`.