Skip to content

Commit

Permalink
DYN-7070 Merge check file version workflow into build workflow (#15308)
Browse files Browse the repository at this point in the history
  • Loading branch information
avidit authored Jun 12, 2024
1 parent 78797d8 commit 588a7b0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 36 deletions.
18 changes: 13 additions & 5 deletions .github/scripts/check_file_version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ if (Test-Path $dynamoSandbox) {
$fileVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($dynamoSandbox).FileVersion
try {
$dynamoVersion = [System.Version]::Parse($fileVersion)
Write-Host "ℹ️ DynamoSandbox.exe - $dynamoVersion`n"
Write-Output "::notice::ℹ️ DynamoSandbox.exe - $dynamoVersion`n"
} catch {
Write-Host "❌ Failed to get the version of DynamoSandbox.exe"
Write-Output "::error::❌ Failed to get the version of DynamoSandbox.exe"
exit 1
}
} else {
Write-Host "⚠️ DynamoSandbox.exe was not found"
Write-Output "::error::⚠️ DynamoSandbox.exe was not found"
exit 1
}

Expand All @@ -107,12 +107,20 @@ foreach ($file in $files) {
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"
$noVersion | ForEach-Object { Write-Host$_.Name - $_.FullName }
$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"
$wrongVersion | ForEach-Object { Write-Host$_.Name - $_.FullName - (Get-Item $_).VersionInfo.FileVersion }
$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
30 changes: 0 additions & 30 deletions .github/workflows/check_file_version.yml

This file was deleted.

0 comments on commit 588a7b0

Please sign in to comment.