Skip to content

Commit 13451e5

Browse files
authored
Test build pipeline to publish to internal ADO (#308)
* Fix issue in VC versioning * Publish to internal ADO feed to work around ADO lag * Modify build pipeline
1 parent d42e6d0 commit 13451e5

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.pipelines/azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ steps:
8686
MaxConcurrency: '50'
8787
MaxRetryAttempts: '5'
8888

89-
- 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
89+
- script: $(Build.SourcesDirectory)\upload-packages-internal.cmd $(Build.SourcesDirectory)\out\packages $(ADOAPIKEY)
9090
displayName: 'Publish NuGet to ADO Artifact Packages as temporary workaround to ADO lagging behind in package availability'
9191

9292
- script: $(Build.SourcesDirectory)\upload-packages.cmd $(Build.SourcesDirectory)\out\packages $(NUGETORGAPIKEY)

upload-packages-internal.cmd

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@echo Off
2+
3+
if /i "%~1" == "/?" Goto :Usage
4+
if /i "%~1" == "-?" Goto :Usage
5+
if /i "%~1" == "--help" Goto :Usage
6+
if /i "%~1" == "" Goto :Usage
7+
if /i "%~2" == "" Goto :Usage
8+
9+
set ExitCode=0
10+
set PackageDirectory=%~1
11+
12+
echo:
13+
echo [Uploading NuGet Packages]
14+
echo --------------------------------------------------
15+
echo Package Directory : %PackageDirectory%
16+
echo Feed : %FeedUri%
17+
echo:
18+
19+
for %%f in (%PackageDirectory%\*.nupkg) do (
20+
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
21+
)
22+
23+
Goto :End
24+
25+
26+
:Usage
27+
echo Invalid Usage.
28+
echo Usage:
29+
echo %~0 {packageDirectory} {nugetApiKey} [{dotnet push args}]
30+
echo:
31+
echo Examples:
32+
echo %~0 S:\source\one\repo\out\bin\Release\x64\Packages apikey
33+
echo %~0 S:\source\one\repo\out\bin\Release\x64\Packages apikey --interactive
34+
Goto :End
35+
36+
37+
:Error
38+
set ExitCode=%ERRORLEVEL%
39+
40+
41+
:End
42+
rem Reset environment variables
43+
set PackageDirectory=
44+
set FeedUri=
45+
46+
echo Build Stage Exit/Error Code: %ExitCode%
47+
exit /B %ExitCode%

0 commit comments

Comments
 (0)