(MAINT) Fix packaging for zip and tgz
#1323
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
This change:
Import-DscBuildDatafunction to retain the root project when refreshing the project data.TgzTarget.Build-RustProjectfunction selects the correct workspace member group when the user specifies an architecture.Build-DscPackagecallsBuild-DscZipPackagewith the required parameters when package type iszip.cleansection of thebuild.ps1script to only reset the Rust environment variables if the caching variable isn't null.This change was tested locally to produce
.tar.gz(WSL) and.zip(Windows 11) packages without errors.PR Context
Prior to this change, there were several issues that prevented the use of the
build.ps1script to package builds forzipandtgz:Import-DscBuildDatafunction erroneously dropped therootproject, which is used to add theNOTICE.txtfile to thebinfolder.Get-ArtifactDirectoryPathfailed to correctly define theTgzTargetproperty due to a mistaken key name (invalid$prefix).Build-RustProjectfunction had a bug in the implementation for specified (rather thancurrent) architectures where incorrect casing caused the workspace member group to be an empty array.Build-DscPackagefunction calledBuild-DscTgzPackagefor thezippackage type without passing any build parameters.cleansection of thebuild.ps1script always tried to reset the Rust environment variables, even when they hadn't been cached.