Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AGD-3334 - Create Release Folders, Implement Github Actions #118

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Empty file.
Empty file added Samples/Revit2023/placeholder
Empty file.
Empty file added Samples/Revit2024/placeholder
Empty file.
Empty file added Samples/Revit2025/placeholder
Empty file.
Empty file added Samples/Revit2026/placeholder
Empty file.
48 changes: 48 additions & 0 deletions Samples/ZipForRelease.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
$samplesPath = $PSScriptRoot
$repoBasePath = Split-Path -Path $samplesPath -Parent
$releasePath = [IO.Path]::Combine($repoBasePath, 'Release')


# delete release folder if it exists so we can recreate it
if (Test-Path -Path $releasePath) {
# Delete the directory if it exists
Remove-Item -Path $releasePath -Recurse -Force
}


$releaseFolder = New-Item -ItemType Directory -Force -Path $releasePath




$revitDirs = Get-ChildItem -Path $samplesPath -Directory
$exclude = @("*.ps1","*.zip")

Foreach ($revitDir in $revitDirs)
{
#revit folder names
$name = $revitDir.name

#sample subfolders
$dirs = Get-ChildItem -Path $mypath/$revitDir -Directory

#Compress-Archive -Path $mypath/$revitDir -DestinationPath $mypath/$name

#iterate through subfolders
Foreach($dir in $dirs)
{
#first revit versions
Compress-Archive -Path $dir -Update -DestinationPath $releasePath/$name

#individual sample names
$sampleName = $revitDir.name + "_" + $dir.name -replace"Revit"

#now each sample
$sampleFiles = Get-ChildItem -Path $dir/
Foreach($sampleFile in $sampleFiles)
{
Compress-Archive -Path $sampleFile -Update -DestinationPath $releasePath/$sampleName
}

}
}