Skip to content

Commit dbb32b9

Browse files
authored
Merge branch 'main' into dependabot/go_modules/internal/tools/golang.org/x/tools-0.32.0
2 parents 660dbc7 + 5e2310f commit dbb32b9

File tree

6 files changed

+160
-3
lines changed

6 files changed

+160
-3
lines changed

.github/workflows/dotnet-instr-deployer-add-on.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
paths:
1010
- 'packaging/dotnet-instr-deployer-add-on/**'
1111
- '.github/workflows/dotnet-instr-deployer-add-on.yml'
12+
schedule:
13+
- cron: '0 1 * * 1,4' # Every Monday and Thursday at 1 AM UTC
1214
workflow_dispatch:
1315
inputs:
1416
splunk_uf_version:
@@ -27,7 +29,7 @@ env:
2729
splunk_uf_build_hash: ${{ github.event.inputs.splunk_uf_build_hash || '6b4ebe426ca6' }}
2830

2931
jobs:
30-
build-pack-test-dotnet-deployer-ta:
32+
build-pack-test-dotnet-instrumentation-deployer-ta:
3133
runs-on: windows-latest
3234

3335
steps:
@@ -86,3 +88,44 @@ jobs:
8688
if: always()
8789
run: |
8890
Get-Content "${Env:ProgramFiles}\SplunkUniversalForwarder\var\log\splunk\splunk_otel_dotnet_deployer.log"
91+
92+
push-release-tag:
93+
name: Push Release Tag
94+
runs-on: ubuntu-24.04
95+
needs: [build-pack-test-dotnet-instrumentation-deployer-ta]
96+
if: github.ref == 'refs/heads/main'
97+
steps:
98+
- name: Checkout
99+
uses: actions/checkout@v4
100+
101+
- name: Read version from app.conf
102+
id: read-app-conf
103+
run: |
104+
version=$(grep -oP '^version = \K.*' packaging/dotnet-instr-deployer-add-on/assets/default/app.conf)
105+
echo "version=$version" >> $GITHUB_OUTPUT
106+
107+
- name: Ensure version is read from app.conf
108+
if: steps.read-app-conf.outputs.version == ''
109+
run: echo "Fail to read version from app.conf" && exit 1
110+
111+
- name: Push new release tag if it doesn't exist
112+
uses: actions/github-script@v7
113+
with:
114+
github-token: ${{ secrets.GITHUB_TOKEN }}
115+
script: |
116+
const tagRef = "tags/dotnet-instrumentation-deployer-ta-v${{ steps.read-app-conf.outputs.version }}"
117+
const existingRefs = await github.rest.git.listMatchingRefs({
118+
owner: context.repo.owner,
119+
repo: context.repo.repo,
120+
ref: tagRef
121+
})
122+
if (existingRefs.data.length === 0) {
123+
await github.rest.git.createRef({
124+
owner: context.repo.owner,
125+
repo: context.repo.repo,
126+
ref: "refs/" + tagRef,
127+
sha: context.sha
128+
})
129+
} else {
130+
console.log(tagRef + " already exists")
131+
}

.gitlab-ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,3 +1838,81 @@ chef-release:
18381838
- cp -r deployments/chef /tmp/cookbooks/splunk_otel_collector
18391839
script:
18401840
- knife supermarket share -o /tmp/cookbooks splunk_otel_collector
1841+
1842+
.trigger-dotnet-instrumentation-deployer:
1843+
only:
1844+
variables:
1845+
- $CI_COMMIT_TAG =~ /^dotnet-instrumentation-deployer-ta-v[0-9]+\.[0-9]+\.[0-9]+[^ ]*$/
1846+
except:
1847+
- schedules
1848+
1849+
build-dotnet-instrumentation-deployer:
1850+
extends: .trigger-dotnet-instrumentation-deployer
1851+
image: '${DOCKER_HUB_REPO}/golang:${GO_VERSION}'
1852+
stage: build
1853+
needs: []
1854+
dependencies: []
1855+
before_script:
1856+
- cd packaging/dotnet-instr-deployer-add-on
1857+
script:
1858+
- make download-dotnet-assets
1859+
- make build
1860+
artifacts:
1861+
paths:
1862+
- packaging/dotnet-instr-deployer-add-on/assets/windows_x86_64/bin/*
1863+
1864+
sign-dotnet-instrumentation-deployer-exe:
1865+
extends:
1866+
- .trigger-dotnet-instrumentation-deployer
1867+
- .submit-signing-request
1868+
stage: sign-binaries
1869+
retry: 2
1870+
dependencies:
1871+
- build-dotnet-instrumentation-deployer
1872+
variables:
1873+
ARTIFACT: packaging/dotnet-instr-deployer-add-on/assets/windows_x86_64/bin/splunk_otel_dotnet_deployer.exe
1874+
SIGN_TYPE: WIN
1875+
DOWNLOAD_DIR: packaging/dotnet-instr-deployer-add-on/assets/windows_x86_64/bin
1876+
artifacts:
1877+
paths:
1878+
- packaging/dotnet-instr-deployer-add-on/assets/windows_x86_64/bin/*
1879+
1880+
1881+
pack-dotnet-instrumentation-deployer:
1882+
extends: .trigger-dotnet-instrumentation-deployer
1883+
image: '${DOCKER_HUB_REPO}/golang:${GO_VERSION}'
1884+
stage: package
1885+
dependencies:
1886+
- sign-dotnet-instrumentation-deployer-exe
1887+
before_script:
1888+
- cd packaging/dotnet-instr-deployer-add-on
1889+
script:
1890+
- make pack
1891+
artifacts:
1892+
paths:
1893+
- packaging/dotnet-instr-deployer-add-on/assets/windows_x86_64/bin/*
1894+
- packaging/dotnet-instr-deployer-add-on/out/distribution/splunk_otel_dotnet_deployer.tgz
1895+
1896+
dotnet-instrumentation-deployer-release:
1897+
extends:
1898+
- .trigger-dotnet-instrumentation-deployer
1899+
- .go-cache # Use this image since this job uses the ghr tool
1900+
stage: github-release
1901+
dependencies:
1902+
- pack-dotnet-instrumentation-deployer
1903+
script:
1904+
- export
1905+
- cd packaging/dotnet-instr-deployer-add-on
1906+
- pushd out/distribution/ && shasum -a 256 * > checksums.txt && popd
1907+
- |
1908+
set -e
1909+
if [[ "${CI_COMMIT_TAG:-}" =~ ^dotnet-instrumentation-deployer-ta-v([0-9]+\.[0-9]+\.[0-9]+[^ ]*) ]]; then
1910+
VERSION=${BASH_REMATCH[1]}
1911+
VERSION_CHANGELOG="$(awk -v version="$VERSION" '/^## / { if (p) { exit }; if ($2 == version) { p=1; next } } p && NF' CHANGELOG.md)"
1912+
SPLUNK_OTEL_DOTNET_VERSION=$(grep -oP 'version = \K.*' assets/windows_x86_64/bin/Splunk.OTel.DotNet.psm1 | tr -d '"')
1913+
RELEASE_NOTES=$(echo -e "$VERSION_CHANGELOG\n\nShipping Splunk OpenTelemetry .NET $SPLUNK_OTEL_DOTNET_VERSION")
1914+
ghr -t "$GITHUB_TOKEN" -u signalfx -r splunk-otel-collector -prerelease -draft -n "Splunk OpenTelemetry .NET Deployer Technical Add-On v$VERSION" -b "$RELEASE_NOTES" -replace "$CI_COMMIT_TAG" out/distribution/
1915+
else
1916+
echo "Failed to get version from $CI_COMMIT_TAG"
1917+
exit 1
1918+
fi
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
## Unreleased
4+
5+
## 0.1.0-beta
6+
7+
- Beta release of the `Splunk OpenTelemetry .NET Deployer Add-On`.

packaging/dotnet-instr-deployer-add-on/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ download-dotnet-assets:
2121
build: ./assets/windows_x86_64/bin/$(MOD_INPUT_NAME).exe
2222
./assets/windows_x86_64/bin/$(MOD_INPUT_NAME).exe: $(shell find ./ -name '*.go')
2323
@echo "Building executable ..."
24-
@go build -o ./assets/windows_x86_64/bin/ ./cmd/$(MOD_INPUT_NAME)/...
24+
@GOOS=windows go build -o ./assets/windows_x86_64/bin/ ./cmd/$(MOD_INPUT_NAME)/...
2525

2626
.PHONY: pack
2727
pack:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Release Process
2+
3+
## Prerequisites
4+
5+
1. You must be able to sign git commits/tags. Follow [this guide](
6+
https://docs.github.com/en/github/authenticating-to-github/signing-commits)
7+
to set it up.
8+
1. You must have access to the `o11y-gdi/splunk-otel-collector-releaser` gitlab
9+
repo and CI/CD pipeline.
10+
11+
## Steps
12+
13+
1. Ensure that the version in [assets/default/app.conf](./assets/default/app.conf)
14+
has been updated to an appropriate semver. If necessary, create a PR with this
15+
change and wait for it to be approved and merged.
16+
1. Check [Github Actions](
17+
https://github.com/signalfx/splunk-otel-collector/actions/workflows/dotnet-instr-deployer-add-on.yml)
18+
and ensure that the workflow completed successfully. A new
19+
`dotnet-instrumentation-deployer-ta-v<VERSION>` tag should be pushed,
20+
where `VERSION` is the version from [assets/default/app.conf](./assets/default/app.conf).
21+
1. Wait for the gitlab repo to be synced with the new tag (may take up to 30
22+
minutes; if you have permissions, you can trigger the sync immediately from
23+
repo settings in gitlab). The CI/CD pipeline will then trigger
24+
automatically for the new tag.
25+
1. Check the gitlab CI/CD pipeline and ensure that the `dotnet-instrumentation-deployer-release`
26+
job completes successfully.
27+
1. The release is created as `prerelease` and `draft` on GitHub. You can
28+
publish it by clicking on the `Publish release` button. The release notes are
29+
automatically generated from the changelog in [CHANGELOG.md](./CHANGELOG.md).

packaging/dotnet-instr-deployer-add-on/assets/default/app.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ label = Splunk OpenTelemetry .NET Deployer
1010
[launcher]
1111
author = Splunk, Inc.
1212
description = A Splunk Technical Add-on that deploys the Splunk Distribution of OpenTelemetry .NET.
13-
version = 1.0.0
13+
version = 0.1.0-beta
1414

1515
[package]
1616
id = splunk_otel_dotnet_deployer

0 commit comments

Comments
 (0)