Skip to content

Commit

Permalink
Separate package upload to nuget.org and Artifactory
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensi committed Jan 16, 2017
1 parent 98a7bc7 commit 48ab289
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 20 deletions.
14 changes: 0 additions & 14 deletions tools/NuGet/BuildAndPostPackages.bat

This file was deleted.

15 changes: 9 additions & 6 deletions tools/NuGet/BuildPackages.bat
@@ -1,14 +1,17 @@
:: Argument %1: path to template folder
::

@echo off
SET base=..\..\src\DynamoInstall\harvest
if not exist %base% (
set harvestPath=..\..\src\DynamoInstall\harvest
if not exist %harvestPath% (
echo Dynamo\src\DynamoInstall\harvest folder not found.
echo Please build Dynamo\src\Install.sln before running this script!
exit /b 1
)

:: Get version string from "DynamoCore.dll"
set count=1
for /f %%f in ('cscript //Nologo ..\install\GetFileVersion.vbs %base%\DynamoCore.dll') do (
for /f %%f in ('cscript //Nologo ..\install\GetFileVersion.vbs %harvestPath%\DynamoCore.dll') do (
setlocal EnableDelayedExpansion
if !count!==1 set Major=%%f
if !count!==2 set Minor=%%f
Expand All @@ -24,9 +27,9 @@ del *.nupkg
if exist nuspec ( rmdir /s /q nuspec )
mkdir nuspec

:: Copy .nuspec files from "template" folder to "nuspec" folder
:: Copy .nuspec files from template folder to "nuspec" folder
:: and replace the string "@VERSION@" with the correct value
for %%f in (template\*.nuspec) do (
for %%f in (%1\*.nuspec) do (
for /f "tokens=* delims=¶" %%i in ( '"type %%f"') do (
set line=%%i
setlocal EnableDelayedExpansion
Expand All @@ -39,5 +42,5 @@ for %%f in (template\*.nuspec) do (
:: Pack .nupkg files based on each .nuspec in the "nuspec" folder
@echo on
for %%f in (nuspec\*.nuspec) do (
nuget pack %%f -basepath %base%
nuget pack %%f -basepath %harvestPath%
)
7 changes: 7 additions & 0 deletions tools/NuGet/PostArtifactoryPackages.bat
@@ -0,0 +1,7 @@
call .\BuildPackages.bat "template-artifactory"

set Artifactory=https://art-bobcat.autodesk.com/artifactory/api/nuget/team-dynamo-nuget

:: Use credentials in config file for pushing package to Artifactory
set configPath=%~dp0..\..\dynamo-nuget.config
nuget push *.nupkg -source %Artifactory% -configfile %configPath%
7 changes: 7 additions & 0 deletions tools/NuGet/PostNugetPackages.bat
@@ -0,0 +1,7 @@
:: Argument %1: API key to upload packages to www.nuget.org
::

call .\BuildPackages.bat "template-nuget"

:: Push these packages to www.nuget.org
nuget push *.nupkg -apikey %1

0 comments on commit 48ab289

Please sign in to comment.