Push NPM packages
This commit is contained in:
parent
4ecafc0afd
commit
6045eff343
|
|
@ -1,5 +1,7 @@
|
|||
<Project>
|
||||
<Target Name="Push">
|
||||
<Target Name="Push" DependsOnTargets="_PushNuGet;_PushNpm" />
|
||||
|
||||
<Target Name="_PushNuGet">
|
||||
<Error Text="Missing required property: NuGetPublishFeed" Condition=" '$(NuGetPublishFeed)' == '' "/>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -20,4 +22,25 @@
|
|||
Condition="@(_LineupPackagesToPush->Count()) != 0"
|
||||
ApiKey="$(APIKey)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_PushNpm">
|
||||
<Error Text="Missing required property: NpmRegistry" Condition=" '$(NpmRegistry)' == '' "/>
|
||||
|
||||
<PropertyGroup>
|
||||
<AuthTokenSetting>$(NpmRegistry.Replace("https:", "")):_authToken</AuthTokenSetting>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<NpmModuleArtifact Include="$(BuildDir)*.tgz" />
|
||||
</ItemGroup>
|
||||
|
||||
<Exec Command="npm config set "$(AuthTokenSetting)" $(APIKey)" Condition=" '$(APIKey)' != '' " />
|
||||
<Exec Command="npm publish --registry $(NpmRegistry) "%(NpmModuleArtifact.Identity)""
|
||||
Condition="@(NpmModuleArtifact->Count()) != 0"
|
||||
ContinueOnError="true">
|
||||
<Output TaskParameter="ExitCode" ItemName="ExitCodes" />
|
||||
</Exec>
|
||||
<Exec Command="npm config delete $(AuthTokenSetting)" Condition=" '$(APIKey)' != '' "/>
|
||||
<Error Text="Publishing npm modules failed" Condition="%(ExitCodes.Identity) > 0"/>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Reference in New Issue