Skip to content

Commit

Permalink
ADD; Add zipped publish folders to release asset lists
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeago committed Oct 1, 2023
1 parent aa0365e commit b4e6437
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ZIP files are created in the artifacts directory `$(ArtifactsDirectory)$(Configuration)`;
- the same publish folder can be zipped _and_ used by InnoSetup, if needed;
- if `Temporary` is set to `true` on a publish folder, it will be deleted after zipping (and after running InnoSetup if required);
- zipped publish folders are added to the release asset list for the project by default, unless their `IsReleaseAsset` metadata is set to `false`;
- `ReleaseAssetDescription` metadata can be set to the textual description for the zipped folder in the release asset list;
- `CreateZipFile` defaults to `true` if `ZipFileName` is set, `false` otherwise;
- if `CreateZipFile` is `true` and `ZipFileName` is not set, the latter defaults to:
- `$(MSBuildProjectName)-%(PublishFolder.Identity)_$(BuildVersion).zip` if the `BuildVersion` property is set (such as when using Nerdbank.GitVersioning);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
Condition="'%(PublishFolder.CreateZipFile)' != 'true'"
CreateZipFile="false" />

<!-- IsReleaseAsset is true by default for zipped folders, always false otherwise -->
<PublishFolder Update="%(PublishFolder.Identity)"
Condition="%(PublishFolder.CreateZipFile) And '%(PublishFolder.IsReleaseAsset)' != 'false'"
IsReleaseAsset="true" />
<PublishFolder Update="%(PublishFolder.Identity)"
Condition="!%(PublishFolder.CreateZipFile)"
IsReleaseAsset="false" />

</ItemGroup>

</Target>
Expand Down Expand Up @@ -82,6 +90,13 @@
DestinationFile="%(PublishFolder.ZipFilePath)"
Overwrite="true" />

<!-- Add created zip files to the release asset list-->
<ItemGroup Condition="'$(GenerateReleaseAssetList)' == 'true'">
<ReleaseAsset Include="%(PublishFolder.ZipFilePath)"
Condition="%(PublishFolder.IsReleaseAsset)"
Description="%(PublishFolder.ReleaseAssetDescription)" />
</ItemGroup>

</Target>

<Target Name="RemoveTemporaryPublishFolders"
Expand Down

0 comments on commit b4e6437

Please sign in to comment.