Skip to content

Commit

Permalink
Test build pipeline to publish to internal ADO (#308)
Browse files Browse the repository at this point in the history
* Fix issue in VC versioning

* Publish to internal ADO feed to work around ADO lag

* Modify build pipeline
  • Loading branch information
yangpanMS authored May 7, 2024
1 parent d42e6d0 commit 13451e5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ steps:
MaxConcurrency: '50'
MaxRetryAttempts: '5'

- script: dotnet nuget push $(Build.SourcesDirectory)\out\packages\*.nupkg --api-key $(ADOAPIKEY) --timeout 1200 --source https://msazure.pkgs.visualstudio.com/_packaging/CRC-VC/nuget/v3/index.json --skip-duplicate
- script: $(Build.SourcesDirectory)\upload-packages-internal.cmd $(Build.SourcesDirectory)\out\packages $(ADOAPIKEY)
displayName: 'Publish NuGet to ADO Artifact Packages as temporary workaround to ADO lagging behind in package availability'

- script: $(Build.SourcesDirectory)\upload-packages.cmd $(Build.SourcesDirectory)\out\packages $(NUGETORGAPIKEY)
Expand Down
47 changes: 47 additions & 0 deletions upload-packages-internal.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@echo Off

if /i "%~1" == "/?" Goto :Usage
if /i "%~1" == "-?" Goto :Usage
if /i "%~1" == "--help" Goto :Usage
if /i "%~1" == "" Goto :Usage
if /i "%~2" == "" Goto :Usage

set ExitCode=0
set PackageDirectory=%~1

echo:
echo [Uploading NuGet Packages]
echo --------------------------------------------------
echo Package Directory : %PackageDirectory%
echo Feed : %FeedUri%
echo:

for %%f in (%PackageDirectory%\*.nupkg) do (
call dotnet nuget push %%f --api-key %~2 --timeout 1200 --source https://msazure.pkgs.visualstudio.com/_packaging/CRC-VC/nuget/v3/index.json --skip-duplicate %~3 && echo: || Goto :Error
)

Goto :End


:Usage
echo Invalid Usage.
echo Usage:
echo %~0 {packageDirectory} {nugetApiKey} [{dotnet push args}]
echo:
echo Examples:
echo %~0 S:\source\one\repo\out\bin\Release\x64\Packages apikey
echo %~0 S:\source\one\repo\out\bin\Release\x64\Packages apikey --interactive
Goto :End


:Error
set ExitCode=%ERRORLEVEL%


:End
rem Reset environment variables
set PackageDirectory=
set FeedUri=

echo Build Stage Exit/Error Code: %ExitCode%
exit /B %ExitCode%

0 comments on commit 13451e5

Please sign in to comment.