Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
Browse files Browse the repository at this point in the history
  • Loading branch information
zeusongit committed Jun 20, 2024
2 parents 79e2f08 + a16334b commit dd3f613
Show file tree
Hide file tree
Showing 59 changed files with 1,803 additions and 304 deletions.
126 changes: 126 additions & 0 deletions .github/scripts/check_file_version.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Check File Version
#
# This script checks the version exe and dll the files in the Dynamo's bin directory.
# It compares the version of each file with the version of DynamoSandbox.exe.
# If the version of a file doesn't match the version of DynamoSandbox.exe, the script will exit with an error code.
#
# https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.fileversioninfo
param (
[Parameter(Mandatory = $true)][string]$path
)

$ErrorActionPreference = "Stop"

$includedFiles = @("*.exe", "*.dll")
$excludedFiles = @(
"*.config",
"*.ds",
"*.json",
"*.md",
"*.rtf",
"*.xml",
"AdpSDKCSharpWrapper.dll",
"AdskIdentitySDK.dll",
"Analytics.NET.*.dll",
"Autodesk*.dll",
"CommandLine.dll",
"Cyotek.Drawing.BitmapFont.dll",
"DiffPlex.dll",
"DocumentFormat.OpenXml.dll",
"DotNetProjects.Wpf.Extended.Toolkit.dll",
"Dynamo.Microsoft.Xaml.Behaviors.dll",
"FontAwesome5*.dll",
"ForgeUnitsManaged.dll",
"Greg.dll",
"HarfBuzzSharp.dll",
"HelixToolkit*.dll",
"ICSharpCode.AvalonEdit.dll",
"J2N.dll",
"JUnit.TestLogger.dll",
"LaunchDarkly.*",
"LibG*.dll",
"libiconv.dll", # https://jira.autodesk.com/browse/DYN-7069
"libintl.dll", # https://jira.autodesk.com/browse/DYN-7069
"libHarfBuzzSharp.dll", # https://jira.autodesk.com/browse/DYN-6598
"libSkiaSharp.dll", # https://jira.autodesk.com/browse/DYN-6598
"LiveChartsCore*.dll",
"Lucene.Net*.dll",
"MIConvexHull.NET Standard.dll",
"Microsoft.*",
"MimeMapping.dll",
"Moq.dll",
"Newtonsoft.Json.dll",
"NuGet.Frameworks.dll",
"nunit*.dll",
"NUnit3*.dll",
"Prism.dll",
"ProtoGeometry*.dll",
"Python*.dll",
"RestSharp.dll",
"SharpDX*.dll",
"SkiaSharp*.dll",
"Spekt.TestLogger.dll",
"StarMath.dll",
"System.*.dll",
"testcentric.engine.metadata.dll",
"testhost.dll",
"testhost.exe",
"Units.dll",
"Webview2Loader.dll"
)
$noVersion = @()
$wrongVersion = @()

$dynamoSandbox = Join-Path -Path $path -ChildPath "DynamoSandbox.exe"
if (Test-Path $dynamoSandbox) {
$fileVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($dynamoSandbox).FileVersion
try {
$dynamoVersion = [System.Version]::Parse($fileVersion)
Write-Output "::notice::ℹ️ DynamoSandbox.exe - $dynamoVersion`n"
} catch {
Write-Output "::error::❌ Failed to get the version of DynamoSandbox.exe"
exit 1
}
} else {
Write-Output "::error::⚠️ DynamoSandbox.exe was not found"
exit 1
}

$files = Get-ChildItem -Path $path -Include $includedFiles -Exclude $excludedFiles -Recurse -File
foreach ($file in $files) {
$name = $file.Name
try {
$fileVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($file).FileVersion
$version = [System.Version]::Parse($fileVersion)
if ($version -eq $dynamoVersion) {
Write-Host "$name - $version"
} else {
Write-Host "$name - $version"
$wrongVersion += $file
}
} catch {
Write-Host "$name"
$noVersion += $file
}
}

if ($noVersion.Count -gt 0 -Or $wrongVersion.Count -gt 0) {
if ($noVersion.Count -gt 0) {
Write-Host "`n`e[4mThe following file(s) don't have version information`e[24m"
$title = "Missing version information"
foreach ($file in $noVersion) {
$message = "$($file.Name) - $($file.FullName)"
Write-Output "::error title=$title::$message"
}
}

if ($wrongVersion.Count -gt 0) {
Write-Host "`n`e[4mThe following file(s) don't have the expected version: $dynamoVersion`e[24m"
$title = "Unexpected version information"
foreach ($file in $wrongVersion) {
$message = "$($file.Name) - $($file.FullName) - $($(Get-Item $file).VersionInfo.FileVersion)"
Write-Output "::error title=$title::$message"
}
}
exit 1
}
4 changes: 3 additions & 1 deletion .github/workflows/build_dynamo_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ jobs:
if (Test-Path -Path "${{ github.workspace }}\Dynamo\bin\AnyCPU\Release\DynamoCLI.exe") {
Write-Output "DynamoCLI.exe exists!"
} else {
Write-Error "DynamoCLI.exe was not found!"
Write-Output "::error title=File Not Found::DynamoCLI.exe was not found!"
}
- name: Check File Version
run: ${{ github.workspace }}\Dynamo\.github\scripts\check_file_version.ps1 ${{ github.workspace }}\Dynamo\bin\AnyCPU\Release
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/build_dynamo_core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Build DynamoCore.sln

on:
push:
branches:
- master
pull_request:

jobs:
build_windows_runtime:
name: Build DynamoCore windows runtime
runs-on: windows-latest
steps:
- name: Checkout Dynamo Repo
uses: actions/checkout@v4
with:
path: Dynamo
repository: DynamoDS/Dynamo
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Disable problem matcher
run: Write-Output "::remove-matcher owner=csc::"
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Install dependencies for windows runtime
run: |
dotnet restore ${{ github.workspace }}\Dynamo\src\DynamoCore.sln /p:Configuration=Release --runtime=win-x64
- name: Build DynamoCore with MSBuild for Windows
run: |
msbuild ${{ github.workspace }}\Dynamo\src\DynamoCore.sln /p:Configuration=Release
- name: Look for DynamoCLI.exe
run: |
Write-Output "***Locating DynamoCLI.exe!***"
if (Test-Path -Path "${{ github.workspace }}\Dynamo\bin\AnyCPU\Release\DynamoCLI.exe") {
Write-Output "DynamoCLI.exe exists!"
} else {
Write-Error "DynamoCLI.exe was not found!"
}
build_linux_runtime_on_windows:
name: Build DynamoCore linux runtime on windows
runs-on: windows-latest
steps:
- name: Checkout Dynamo Repo
uses: actions/checkout@v4
with:
path: Dynamo
repository: DynamoDS/Dynamo
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Disable problem matcher
run: Write-Output "::remove-matcher owner=csc::"
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Install dependencies for linux runtime
run: dotnet restore ${{ github.workspace }}\Dynamo\src\DynamoCore.sln -p:Platform=NET_Linux --runtime=linux-x64
- name: Build DynamoCore with MSBuild for Linux
run: msbuild ${{ github.workspace }}\Dynamo\src\DynamoCore.sln /p:Configuration=Release /p:Platform=NET_Linux
- name: Look for DynamoCLI
run: |
Write-Output "***Locating DynamoCLI for Linux!***"
if (Test-Path -Path "${{ github.workspace }}\Dynamo\bin\NET_Linux\Release\DynamoCLI") {
Write-Output "DynamoCLI exists!"
} else {
Write-Error "DynamoCLI was not found!"
}
build_linux_runtime_on_linux:
name: Build DynamoCore linux runtime on linux
runs-on: ubuntu-latest
steps:
- name: Checkout Dynamo Repo
uses: actions/checkout@v4
with:
path: Dynamo
- 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 linux runtime
run: dotnet restore ${{ github.workspace }}/Dynamo/src/DynamoCore.sln -p:Platform=NET_Linux --runtime=linux-x64
- name: Build DynamoCore with dotnet for Linux
run: dotnet build ${{ github.workspace }}/Dynamo/src/DynamoCore.sln -c Release /p:Platform=NET_Linux
- name: Look for DynamoCLI.exe
run: |
echo "***Locating DynamoCLI for Linux!***"
cd "${{ github.workspace }}/Dynamo/bin/NET_Linux/Release"
test "./DynamoCLI.exe" && echo "DynamoCLI exists!"
- name: Run smoke tests
run: |
cd "${{ github.workspace }}/Dynamo/bin/NET_Linux/Release"
# TODO unfortunately dotnet does not find any tests in this assembly.
# dotnet test DynamoCoreTests.dll --filter "TestCategory~UnitTest"
40 changes: 0 additions & 40 deletions .github/workflows/build_dynamo_core_linux.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/build_dynamo_core_windows.yml

This file was deleted.

Loading

0 comments on commit dd3f613

Please sign in to comment.