Skip to content

Commit 8321588

Browse files
[infra] Use Artifacts Output layout (#6301)
Co-authored-by: Rajkumar Rangaraj <[email protected]>
1 parent 6216221 commit 8321588

File tree

11 files changed

+21
-9
lines changed

11 files changed

+21
-9
lines changed

.github/workflows/package-validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
3131
with:
3232
name: packages-stable
33-
path: '.\src\**\*.*nupkg'
33+
path: ./artifacts/package/release
3434
if-no-files-found: error
3535

3636
run-package-validation-experimental:
@@ -54,5 +54,5 @@ jobs:
5454
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5555
with:
5656
name: packages-experimental
57-
path: '.\src\**\*.*nupkg'
57+
path: ./artifacts/package/release
5858
if-no-files-found: error

.github/workflows/publish-packages-1.0.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
foreach ($projectFile in $projectFiles) {
6868
$projectName = [System.IO.Path]::GetFileNameWithoutExtension($projectFile)
6969
70-
Get-ChildItem -Path src/$projectName/bin/Release/*/$projectName.dll -File | ForEach-Object {
70+
Get-ChildItem -Path artifacts/bin/$projectName/release_*/$projectName.dll -File | ForEach-Object {
7171
$fileFullPath = $_.FullName
7272
Write-Host "Signing $fileFullPath"
7373
@@ -83,15 +83,16 @@ jobs:
8383
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
8484
with:
8585
name: ${{ github.ref_name }}-packages
86-
path: 'src/**/*.*nupkg'
86+
path: ./artifacts/package/release
87+
if-no-files-found: error
8788

8889
- name: Publish MyGet
8990
env:
9091
MYGET_TOKEN_EXISTS: ${{ secrets.MYGET_TOKEN != '' }}
9192
if: env.MYGET_TOKEN_EXISTS == 'true' # Skip MyGet publish if run on a fork without the secret
9293
run: |
9394
nuget setApiKey ${{ secrets.MYGET_TOKEN }} -Source https://www.myget.org/F/opentelemetry/api/v2/package
94-
nuget push src/**/*.nupkg -Source https://www.myget.org/F/opentelemetry/api/v2/package
95+
nuget push ./artifacts/package/release/*.nupkg -Source https://www.myget.org/F/opentelemetry/api/v2/package
9596
9697
post-build:
9798
runs-on: ubuntu-22.04

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
x64/
2222
x86/
2323
bld/
24+
[Aa]rtifacts/
2425
[Bb]in/
2526
[Oo]bj/
2627
[Ll]og/

Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ArtifactsPath>$([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', 'artifacts'))</ArtifactsPath>
4+
<UseArtifactsOutput>true</UseArtifactsOutput>
5+
</PropertyGroup>
6+
</Project>

build/Common.prod.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<PackageProjectUrl>https://opentelemetry.io</PackageProjectUrl>
1919
<Authors>OpenTelemetry Authors</Authors>
2020
<Copyright>Copyright The OpenTelemetry Authors</Copyright>
21-
<PackageOutputPath Condition="$(Build_ArtifactStagingDirectory) != ''">$(Build_ArtifactStagingDirectory)</PackageOutputPath>
2221
<IncludeSymbols>true</IncludeSymbols>
2322
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2423
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>

build/scripts/test-aot-compatibility.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ if ($LastExitCode -ne 0)
2424
Write-Host $publishOutput
2525
}
2626

27-
$runtime = $IsWindows ? "win-x64" : ($IsMacOS ? "macos-x64" : "linux-x64")
2827
$app = $IsWindows ? "./OpenTelemetry.AotCompatibility.TestApp.exe" : "./OpenTelemetry.AotCompatibility.TestApp"
2928

30-
Push-Location $rootDirectory/test/OpenTelemetry.AotCompatibility.TestApp/bin/Release/$targetNetFramework/$runtime
29+
Push-Location $rootDirectory/artifacts/publish/OpenTelemetry.AotCompatibility.TestApp/release_$targetNetFramework
3130

3231
Write-Host "Executing test App..."
3332
$app

build/scripts/test-threadSafety.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if ($LASTEXITCODE -ne 0) {
2626
throw "dotnet build failed with exit code $LASTEXITCODE"
2727
}
2828

29-
$artifactsPath = Join-Path $rootDirectory "test/$testProjectName/bin/$configuration/$targetFramework"
29+
$artifactsPath = Join-Path $rootDirectory "artifacts/bin/$testProjectName/$($configuration.ToLowerInvariant())_$targetFramework"
3030

3131
Write-Host "Generate Coyote rewriting options JSON file."
3232
$assemblies = Get-ChildItem $artifactsPath -Filter OpenTelemetry*.dll | ForEach-Object {$_.Name}

docs/Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<Project>
2+
<Import Project="$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), '..', 'Directory.Build.props'))" />
23
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenTelemetry.sln'))\build\Common.nonprod.props" />
34

45
<PropertyGroup>
56
<OutputType>Exe</OutputType>
67
<TargetFrameworks>$(TargetFrameworksForDocs)</TargetFrameworks>
8+
<!-- Opt-out of Artifacts Output for docs as there are duplicated project names -->
9+
<UseArtifactsOutput>false</UseArtifactsOutput>
710
</PropertyGroup>
811
</Project>

examples/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<Project>
2+
<Import Project="$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), '..', 'Directory.Build.props'))" />
23
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenTelemetry.sln'))\build\Common.nonprod.props" />
34
</Project>

src/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<Project>
2+
<Import Project="$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), '..', 'Directory.Build.props'))" />
23
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenTelemetry.sln'))\build\Common.prod.props" />
34
</Project>

0 commit comments

Comments
 (0)