-
Notifications
You must be signed in to change notification settings - Fork 9
Enable deterministic builds #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
df9307f
Enable deterministic builds
martincostello b227a92
Use Artifacts Output
martincostello 0a7f8a3
Bump NuGet packages
martincostello 9b8faae
Refactor CI
martincostello dc2e96b
Update .NET SDK
martincostello a81dcf0
Fix MinVer
martincostello ae5227c
Simplify job names
martincostello 46e9dd9
Bump MinVer
martincostello 1444629
Fix determinsm
martincostello dbb4b18
Suppress NU5104
martincostello c5a07a5
Add package README
martincostello 270dccc
Update badge URLs
martincostello File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| name: ci | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| paths-ignore: | ||
| - '**.md' | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
| DOTNET_NOLOGO: true | ||
| DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1 | ||
| NUGET_XMLDOC_MODE: skip | ||
| TERM: xterm | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| build-test: | ||
| name: ${{ matrix.os-name }} | ||
| runs-on: ${{ matrix.runner }} | ||
|
|
||
| outputs: | ||
| dotnet-sdk-version: ${{ steps.setup-dotnet.outputs.dotnet-version }} | ||
|
|
||
| permissions: | ||
| attestations: write | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os-name: macos | ||
| runner: macos-latest | ||
| - os-name: linux | ||
| runner: ubuntu-latest | ||
| - os-name: windows | ||
| runner: windows-latest | ||
|
|
||
| steps: | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| fetch-depth: 0 | ||
| filter: 'tree:0' | ||
| show-progress: false | ||
|
|
||
| - name: Setup .NET SDK | ||
| uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1 | ||
| id: setup-dotnet | ||
|
|
||
| - name: Build | ||
| run: dotnet build --configuration Release | ||
|
|
||
| - name: Test | ||
| run: dotnet test --configuration Release --logger:"GitHubActions;report-warnings=false" | ||
|
|
||
| - name: Generate SBOM | ||
| uses: anchore/sbom-action@9f7302141466aa6482940f15371237e9d9f4c34a # v0.19.0 | ||
| with: | ||
| artifact-name: build-${{ matrix.os-name }}.spdx.json | ||
| output-file: ./artifacts/build.spdx.json | ||
| path: ./artifacts/bin | ||
| upload-release-assets: ${{ runner.os == 'Windows' }} | ||
|
|
||
| - name: Attest artifacts | ||
| uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0 | ||
| if: | | ||
| runner.os == 'Windows' && | ||
| github.event.repository.fork == false && | ||
| (github.ref_name == github.event.repository.default_branch || startsWith(github.ref, 'refs/tags/')) | ||
| with: | ||
| subject-path: | | ||
| ./artifacts/bin/Grafana.OpenTelemetry*/release*/Grafana.OpenTelemetry*.dll | ||
| ./artifacts/package/release/* | ||
|
|
||
| - name: Publish NuGet packages | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| with: | ||
| name: packages-${{ matrix.os-name }} | ||
| path: ./artifacts/package/release | ||
| if-no-files-found: error | ||
|
|
||
| validate-packages: | ||
| needs: build-test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
| - name: Download packages | ||
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | ||
| with: | ||
| name: packages-windows | ||
|
|
||
| - name: Setup .NET SDK | ||
| uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1 | ||
| with: | ||
| dotnet-version: ${{ needs.build-test.outputs.dotnet-sdk-version }} | ||
|
|
||
| - name: Validate NuGet packages | ||
| shell: pwsh | ||
| run: | | ||
| dotnet tool install --global dotnet-validate --version 0.0.1-preview.304 --allow-roll-forward | ||
| $packages = Get-ChildItem -Filter "*.nupkg" | ForEach-Object { $_.FullName } | ||
| $invalidPackages = 0 | ||
| foreach ($package in $packages) { | ||
| dotnet validate package local $package | ||
| if ($LASTEXITCODE -ne 0) { | ||
| $invalidPackages++ | ||
| } | ||
| } | ||
| if ($invalidPackages -gt 0) { | ||
| Write-Output "::error::$invalidPackages NuGet package(s) failed validation." | ||
| exit 1 | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
| mono_crash.* | ||
|
|
||
| # Build results | ||
| [Aa]rtifacts/ | ||
| [Bb]uild/ | ||
| [Dd]ebug/ | ||
| [Dd]ebugPublic/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <Project> | ||
| <PropertyGroup> | ||
| <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> | ||
| <Authors>Grafana Labs</Authors> | ||
| <ChecksumAlgorithm>SHA256</ChecksumAlgorithm> | ||
| <Company>Grafana Labs</Company> | ||
| <ContinuousIntegrationBuild Condition=" '$(CI)' != '' ">true</ContinuousIntegrationBuild> | ||
| <Copyright>Copyright (c) Grafana Labs</Copyright> | ||
| <Deterministic>true</Deterministic> | ||
| <EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
| <GenerateDocumentationFile>false</GenerateDocumentationFile> | ||
| <NeutralLanguage>en-US</NeutralLanguage> | ||
| <!-- Disable warning about stable packages depending on prerelease packages until all OpenTelemetry dependencies are stable --> | ||
| <NoWarn>$(NoWarn);NU5104</NoWarn> | ||
| <Nullable>disable</Nullable> | ||
| <PackageIcon>Grafana_icon.png</PackageIcon> | ||
| <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | ||
| <PackageProjectUrl>https://grafana.com/docs/grafana-cloud/monitor-applications/application-observability/</PackageProjectUrl> | ||
| <PackageReadmeFile>package-readme.md</PackageReadmeFile> | ||
| <PackageReleaseNotes>https://github.com/grafana/grafana-opentelemetry-dotnet/blob/main/CHANGELOG.md</PackageReleaseNotes> | ||
| <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> | ||
| <PackageTags>OpenTelemetry;Grafana;Metrics;Logs;Traces;Observability;Monitoring</PackageTags> | ||
| <PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
| <RepositoryType>git</RepositoryType> | ||
| <RepositoryUrl>https://github.com/grafana/grafana-opentelemetry-dotnet</RepositoryUrl> | ||
| <SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
| <TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
| <UseArtifactsOutput>true</UseArtifactsOutput> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <None Include="$(MSBuildThisFileDirectory)/internal/img/$(PackageIcon)" Pack="true" PackagePath="" /> | ||
| <None Include="$(MsBuildThisFileDirectory)/$(PackageReadmeFile)" Pack="true" PackagePath="" /> | ||
| </ItemGroup> | ||
| </Project> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| { | ||
| "sdk": { | ||
| "rollForward": "latestFeature", | ||
| "version": "8.0.101", | ||
| "version": "8.0.410", | ||
| "allowPrerelease": false | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Grafana OpenTelemetry distribution for .NET | ||
|
|
||
| <!-- markdown-link-check-disable --> | ||
| [![NuGet][package-badge-version]][package-download] | ||
| [![SDK][otel-badge]][otel] | ||
| [![Slack][slack-badge]][slack-channel] | ||
| <!-- markdown-link-check-enable --> | ||
|
|
||
| ## About | ||
|
|
||
| This is a pre-configured and pre-packaged bundle of [OpenTelemetry .NET components][otel-contrib], | ||
| optimized for [Grafana Cloud Application Observability][app-o11y]. | ||
|
|
||
| It requires only minimal setup and configuration and makes it very easy to emit | ||
| OpenTelemetry metrics, logs, and traces from your .NET application. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ### Step 1: Install package | ||
|
|
||
| For installing the distribution with the full set of dependencies, add a | ||
| reference to the [`Grafana.OpenTelemetry`][package] package to your project. | ||
|
|
||
| ```sh | ||
| dotnet add package Grafana.OpenTelemetry | ||
| ``` | ||
|
|
||
| ### Step 2: Enable the Grafana distribution at application startup | ||
|
|
||
| The `UseGrafana` extension method on the `TracerProviderBuilder` or the | ||
| `MetricProviderBuilder` can be used to set up the Grafana distribution. By | ||
| default, telemetry data will be sent to Grafana Alloy or an OpenTelemetry collector | ||
| that runs locally and listens to default OTLP ports. | ||
|
|
||
| ```csharp | ||
| using var tracerProvider = Sdk.CreateTracerProviderBuilder() | ||
| .UseGrafana() | ||
| .Build(); | ||
| ``` | ||
|
|
||
| Alternatively, you can send telemetry data directly to Grafana Cloud without | ||
| involving an agent or collector. This can be configured via the environment | ||
| variables `OTEL_EXPORTER_OTLP_PROTOCOL`, `OTEL_EXPORTER_OTLP_ENDPOINT`, and | ||
| `OTEL_EXPORTER_OTLP_HEADERS`. | ||
|
|
||
| For details on how to obtain those values, refer to | ||
| [Send data to the Grafana Cloud OTLP endpoint: Quickstart architecture][push-oltp]. | ||
|
|
||
| ## Documentation | ||
|
|
||
| For detailed documentation and setup instructions, refer to [our documentation][docs]. | ||
|
|
||
| [app-o11y]: https://grafana.com/docs/grafana-cloud/monitor-applications/application-observability/ | ||
| [docs]: https://github.com/grafana/grafana-opentelemetry-dotnet/tree/main/docs | ||
| [otel]: https://github.com/open-telemetry/opentelemetry-dotnet | ||
| [otel-badge]: https://img.shields.io/badge/OTel--SDK-1.9.0-blue?style=flat&logo=opentelemetry | ||
| [otel-contrib]: http://github.com/open-telemetry/opentelemetry-dotnet-contrib | ||
| [package]: https://www.nuget.org/packages/Grafana.OpenTelemetry | ||
| [package-badge-version]: https://img.shields.io/nuget/v/Grafana.OpenTelemetry?logo=nuget&label=NuGet&color=blue | ||
| [package-download]: https://www.nuget.org/profiles/Grafana | ||
| [push-oltp]: https://grafana.com/docs/grafana-cloud/send-data/otlp/send-data-otlp/#quickstart-architecture | ||
| [slack-badge]: https://img.shields.io/badge/%20Slack-%23app--o11y-brightgreen.svg?logo=slack | ||
| [slack-channel]: https://grafana.slack.com/archives/C05E87XRK3J |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.