|
22 | 22 | <Target Name="Build" /> |
23 | 23 |
|
24 | 24 | <PropertyGroup> |
25 | | - <YarpArchiveBaseName>$([MSBuild]::NormalizeDirectory('$(YarpAppArtifactsOutputDir)', '$(YarpAppRuntime)'))reverse-proxy-$(YarpAppRuntime)</YarpArchiveBaseName> |
26 | | - <YarpArchiveZipName>$(YarpArchiveBaseName).zip</YarpArchiveZipName> |
27 | | - <YarpArchiveSha512Name>$(YarpArchiveZipName).sha512</YarpArchiveSha512Name> |
| 25 | + <YarpArchiveDirectory>$([MSBuild]::NormalizeDirectory('$(YarpAppArtifactsOutputDir)', '$(YarpAppRuntime)'))</YarpArchiveDirectory> |
| 26 | + <YarpArchiveBaseName>$(YarpArchiveDirectory)reverse-proxy-$(YarpAppRuntime)</YarpArchiveBaseName> |
| 27 | + <YarpArchiveFileName>$(YarpArchiveBaseName).tar.gz</YarpArchiveFileName> |
| 28 | + <YarpArchiveSha512Name>$(YarpArchiveFileName).sha512</YarpArchiveSha512Name> |
| 29 | + <DirectoryToArchive>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'Yarp.Application', '$(Configuration)', '$(TargetFramework)', '$(YarpAppRuntime)/', 'publish'))</DirectoryToArchive> |
28 | 30 | </PropertyGroup> |
29 | 31 |
|
30 | 32 | <Target Name="BeforeBuild" BeforeTargets="Build"> |
|
34 | 36 | <ItemGroup> |
35 | 37 | <_PublishItems Include="$(ArtifactsBinDir)/Yarp.Application/$(Configuration)/$(TargetFramework)/$(YarpAppRuntime)/publish/**/*" /> |
36 | 38 | <None Include="@(_PublishItems)" Pack="true" PackagePath="tools/" /> |
37 | | - <GenerateChecksumItems Include="$(YarpArchiveZipName)"> |
| 39 | + <GenerateChecksumItems Include="$(YarpArchiveFileName)"> |
38 | 40 | <DestinationPath>$(YarpArchiveSha512Name)</DestinationPath> |
39 | 41 | </GenerateChecksumItems> |
40 | 42 | </ItemGroup> |
41 | 43 |
|
42 | | - <MakeDir Directories="$(YarpAppArtifactsOutputDir)/$(YarpAppRuntime)" /> |
43 | | - <ZipDirectory |
44 | | - SourceDirectory="$(ArtifactsBinDir)/Yarp.Application/$(Configuration)/$(TargetFramework)/$(YarpAppRuntime)/publish" |
45 | | - DestinationFile="$(YarpArchiveZipName)" |
46 | | - Overwrite="true" /> |
| 44 | + <MakeDir Directories="$(YarpArchiveDirectory)" /> |
| 45 | + <Exec Command="tar -cvzf $(YarpArchiveFileName) ." |
| 46 | + IgnoreExitCode="false" |
| 47 | + WorkingDirectory="$(DirectoryToArchive)" /> |
47 | 48 |
|
48 | 49 | <!-- Throw an error if _PublishItems is empty. --> |
49 | 50 | <Error Condition="'@(_PublishItems)' == ''" Text="No files were found to pack. Ensure that the project being packed has a publish target defined." /> |
|
0 commit comments