Skip to content

Commit

Permalink
Add workflow for the deployer (#5958)
Browse files Browse the repository at this point in the history
* Add workflow for the deployer

* Update wrapper script

* Fix typo
  • Loading branch information
pjanotti authored Mar 7, 2025
1 parent 97e16ee commit f36f26f
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 5 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/dotnet-instr-deployer-add-on.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: .NET Instrumentation Deployer Add-On

on:
push:
paths:
- 'packaging/dotnet-instr-deployer-add-on/**'
pull_request:
paths:
- 'packaging/dotnet-instr-deployer-add-on/**'
workflow_dispatch:

env:
GO_VERSION: 1.23.6

jobs:
build:
runs-on: windows-latest

steps:

- name: Check out the codebase.
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Unit tests
working-directory: ./packaging/dotnet-instr-deployer-add-on
shell: bash
run: make test

- name: Build and Package the .NET Instrumentation Deployer Add-On
working-directory: ./packaging/dotnet-instr-deployer-add-on
shell: bash
run: make build-pack

- name: Upload the .NET Instrumentation Deployer Add-On
uses: actions/upload-artifact@v4
with:
name: splunk_otel_dotnet_deployer
path: ./packaging/dotnet-instr-deployer-add-on/out/distribution/splunk_otel_dotnet_deployer.tgz
4 changes: 2 additions & 2 deletions packaging/dotnet-instr-deployer-add-on/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ include ../../Makefile.Common

MOD_INPUT_NAME = splunk_otel_dotnet_deployer

.PHONY: all
all: download-dotnet-assets build pack
.PHONY: build-pack
build-pack: download-dotnet-assets build pack

.PHONY: download-dotnet-assets
download-dotnet-assets:
Expand Down
2 changes: 1 addition & 1 deletion packaging/dotnet-instr-deployer-add-on/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ configuration options.

This project was developed on Windows, using `MINGW64` tools and the `bash`
provided by Git for Windows. Check the [Makefile](./Makefile) for the available
targets - the default target generates the technical add-on under
targets - use the `build-pack` target to generate the technical add-on under
`./out/distribution`.

### Sources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,29 @@ $otelSDKInstallVersion = Get-OpenTelemetryInstallVersion

if ($uninstall) {
if ($otelSDKInstallVersion) {
# TODO: Is it necessary to uninstall for IIS specifically?
Write-Host "Uninstalling Splunk Distribution of OpenTelemetry .NET ..."
Uninstall-OpenTelemetryCore

$w3svc = Get-Service -name "W3SVC" -ErrorAction SilentlyContinue
$was = Get-Service -name "WAS" -ErrorAction SilentlyContinue
if ($w3svc -And $was) {
Write-Host "Unregistering OpenTelemetry for IIS ..."
Unregister-OpenTelemetryForIIS
}

Write-Host "Splunk Distribution of OpenTelemetry .NET uninstalled successfully"
} else {
Write-Host "Nothing to do since Splunk Distribution of OpenTelemetry .NET is not installed"
}
# Install the SDK if it is not already installed
} elseif ($otelSDKInstallVersion) {
Write-Host "Nothing to do since Splunk Distribution of OpenTelemetry .NET is already installed. OpenTelelemetry .NET SDK version: $otelSDKInstallVersion"
Write-Host "Nothing to do since Splunk Distribution of OpenTelemetry .NET is already installed. OpenTelemetry .NET SDK version: $otelSDKInstallVersion"
} else {
Write-Host "Installing Splunk Distribution of OpenTelemetry .NET ..."

# Avoid issues with NGEN assemblies by forcing SingleDomain mode.
RUN Set-ItemProperty -Path "HKLM:\\SOFTWARE\\Microsoft\\.NETFramework" -Name "LoaderOptimization" -Value 1 -Type DWord

$zipPath = Join-Path $scriptDir "splunk-opentelemetry-dotnet-windows.zip"
Install-OpenTelemetryCore -LocalPath $zipPath

Expand Down

0 comments on commit f36f26f

Please sign in to comment.