Skip to content

Commit 060229c

Browse files
[infra] Use Artifacts Output layout
Use Artifacts Output layout to make build output easy to locate. Relates to open-telemetry/opentelemetry-dotnet#6256.
1 parent 2fa2fdc commit 060229c

File tree

9 files changed

+16
-11
lines changed

9 files changed

+16
-11
lines changed

.github/workflows/Component.BuildTest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,5 @@ jobs:
174174
if: ${{ matrix.os == 'windows-latest' && inputs.pack && strategy.job-index == 0 }}
175175
with:
176176
name: ${{ steps.resolve-project.outputs.name }}-packages
177-
path: '.\src\**\*.*nupkg'
177+
path: ./artifacts/package/release
178178
if-no-files-found: error

.github/workflows/publish-packages.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,22 @@ jobs:
8686
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
8787
with:
8888
name: ${{ github.ref_name }}-packages
89-
path: 'src\**\*.*nupkg'
89+
path: ./artifacts/package/release
90+
if-no-files-found: error
9091

9192
- name: Publish MyGet
9293
env:
9394
MYGET_TOKEN_EXISTS: ${{ secrets.MYGET_TOKEN != '' }}
9495
if: env.MYGET_TOKEN_EXISTS == 'true' # Skip MyGet publish if run on a fork without the secret
9596
run: |
96-
nuget setApiKey ${{ secrets.MYGET_TOKEN }} -Source https://www.myget.org/F/opentelemetry/api/v2/package
97-
nuget push src\**\*.nupkg -Source https://www.myget.org/F/opentelemetry/api/v2/package
97+
nuget push ./artifacts/package/release/*.nupkg -Source https://www.myget.org/F/opentelemetry/api/v2/package -ApiKey ${{ secrets.MYGET_TOKEN }}
9898
9999
- name: Publish NuGets
100100
env:
101101
NUGET_TOKEN_EXISTS: ${{ secrets.NUGET_TOKEN != '' }}
102102
if: github.ref_type == 'tag' && env.NUGET_TOKEN_EXISTS == 'true' # Skip NuGet publish for scheduled nightly builds or if run on a fork without the secret
103103
run: |
104-
nuget push src\**\*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_TOKEN }} -SymbolApiKey ${{ secrets.NUGET_TOKEN }}
104+
nuget push ./artifacts/package/release/*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_TOKEN }} -SymbolApiKey ${{ secrets.NUGET_TOKEN }}
105105
106106
post-build:
107107
runs-on: ubuntu-22.04

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
mono_crash.*
1818

1919
# Build results
20+
[Aa]rtifacts/
2021
[Dd]ebug/
2122
[Dd]ebugPublic/
2223
[Rr]elease/

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
@@ -13,7 +13,6 @@
1313
<Copyright>Copyright The OpenTelemetry Authors</Copyright>
1414
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/OpenTelemetryContrib.prod.ruleset</CodeAnalysisRuleSet>
1515
<NoWarn>$(NoWarn);1573;1712</NoWarn>
16-
<PackageOutputPath Condition="$(Build_ArtifactStagingDirectory) != ''">$(Build_ArtifactStagingDirectory)</PackageOutputPath>
1716
<!--<MinVerVerbosity>detailed</MinVerVerbosity>-->
1817
<PackageTags>Observability;OpenTelemetry;Monitoring;Telemetry</PackageTags>
1918
<EnablePackageValidation Condition="'$(EnablePackageValidation)' == ''">false</EnablePackageValidation>

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

examples/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<Project>
2-
<Import Project="..\Directory.Build.props" Condition="Exists('..\Directory.Build.props')" />
2+
<Import Project="$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), '..', 'Directory.Build.props'))" />
33
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'opentelemetry-dotnet-contrib.sln'))\build\Common.nonprod.props" />
44
</Project>

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<Project>
2-
<Import Project="..\Directory.Build.props" Condition="Exists('..\Directory.Build.props')" />
2+
<Import Project="$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), '..', 'Directory.Build.props'))" />
33
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'opentelemetry-dotnet-contrib.sln'))\build\Common.prod.props" />
44
</Project>

test/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<Project>
2-
<Import Project="..\Directory.Build.props" Condition="Exists('..\Directory.Build.props')" />
2+
<Import Project="$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), '..', 'Directory.Build.props'))" />
33
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'opentelemetry-dotnet-contrib.sln'))\build\Common.nonprod.props" />
44
</Project>

0 commit comments

Comments
 (0)