Skip to content

Commit 2a990b1

Browse files
authored
[chore][msi] Build custom actions dll as platform agnostic (#7269)
* [chore][msi] Build custom actions as platform agnostic * Take advantage of the portable dll
1 parent 860e83a commit 2a990b1

File tree

8 files changed

+18
-39
lines changed

8 files changed

+18
-39
lines changed

.github/workflows/ansible.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,7 @@ jobs:
6969

7070
msi-custom-actions:
7171
needs: lint
72-
strategy:
73-
matrix:
74-
OS: [ "windows-2025" ]
7572
uses: ./.github/workflows/reusable-msi-custom-actions.yml
76-
with:
77-
OS: ${{ matrix.OS }}
78-
ARCH: "x64"
7973

8074
msi-build:
8175
needs: [ cross-compile, agent-bundle-windows, msi-custom-actions ]

.github/workflows/chef-test.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,7 @@ jobs:
6767

6868
msi-custom-actions:
6969
needs: [ chef-lint-spec-test ]
70-
strategy:
71-
matrix:
72-
OS: [ "windows-2025" ]
7370
uses: ./.github/workflows/reusable-msi-custom-actions.yml
74-
with:
75-
OS: ${{ matrix.OS }}
76-
ARCH: "x64"
7771

7872
msi-build:
7973
needs: [ cross-compile, agent-bundle-windows, msi-custom-actions ]

.github/workflows/puppet-test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,6 @@ jobs:
234234

235235
puppet-build-windows-msi-custom-actions:
236236
uses: ./.github/workflows/reusable-msi-custom-actions.yml
237-
with:
238-
OS: windows-2022
239-
ARCH: x64
240237

241238
# Use reusable workflow for MSI build
242239
puppet-build-windows-msi-local-package:

.github/workflows/reusable-msi-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: Downloading msi-custom-actions
6060
uses: actions/download-artifact@v7
6161
with:
62-
name: msi-custom-actions-${{ inputs.OS }}
62+
name: msi-custom-actions
6363
path: ./packaging/msi/SplunkCustomActions/bin/Release
6464

6565
- name: Build MSI

.github/workflows/reusable-msi-custom-actions.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,30 @@ name: msi-custom-actions
22

33
on:
44
workflow_call:
5-
inputs:
6-
OS:
7-
required: true
8-
type: string
9-
ARCH:
10-
required: true
11-
type: string
5+
126
jobs:
137
msi-custom-actions:
14-
runs-on: ${{ inputs.OS }}
8+
# WiX requires Windows, but what matters for the custom actions build is the
9+
# .NET SDK version, that is being pinned via a dedicated step.
10+
runs-on: windows-2025
1511
steps:
12+
- name: Setup .NET
13+
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # tag: v5.1.0
14+
with:
15+
dotnet-version: 10.0.103
16+
1617
- name: Check out the codebase.
1718
uses: actions/checkout@v5
1819

1920
- name: Build Custom Actions
2021
working-directory: packaging/msi/SplunkCustomActions
2122
run: |
2223
dotnet test ./test/SplunkCustomActionsTests.csproj -c Release
23-
dotnet build ./src/SplunkCustomActions.csproj -c Release -p:Platform=${{ inputs.ARCH }} -o ./bin/Release
24+
dotnet build ./src/SplunkCustomActions.csproj -c Release -p:Platform="Any CPU" -o ./bin/Release
2425
mkdir "${{ github.workspace }}/dist"
25-
cp ./bin/Release/SplunkCustomActions.CA.dll "${{ github.workspace }}/dist/SplunkCustomActions-${{ inputs.ARCH }}.CA.dll"
26+
cp ./bin/Release/SplunkCustomActions.CA.dll "${{ github.workspace }}/dist/SplunkCustomActions.CA.dll"
2627
2728
- uses: actions/upload-artifact@v6
2829
with:
29-
name: msi-custom-actions-${{ inputs.OS }}
30-
path: ./dist/SplunkCustomActions-${{ inputs.ARCH }}.CA.dll
30+
name: msi-custom-actions
31+
path: ./dist/SplunkCustomActions.CA.dll

.github/workflows/win-package-test.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,7 @@ jobs:
4444
OS: ${{ matrix.OS.runner }}
4545

4646
msi-custom-actions:
47-
strategy:
48-
matrix:
49-
OS: [ {"runner": "windows-2022", "arch": "x64"}, {"runner": "windows-2025", "arch": "x64"}, {"runner": "windows-11-arm", "arch": "arm64"} ]
5047
uses: ./.github/workflows/reusable-msi-custom-actions.yml
51-
with:
52-
OS: ${{ matrix.OS.runner }}
53-
ARCH: ${{ matrix.OS.arch }}
5448

5549
msi-build:
5650
strategy:

packaging/msi/msi-builder/build.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,15 @@ parse_args_and_build() {
172172

173173
cd ${WORK_DIR}
174174

175-
dotnetarch="x64"
175+
wixarch="x64"
176176
if [[ "$os" =~ "arm" ]]; then
177-
dotnetarch="arm64"
177+
wixarch="arm64"
178178
fi
179179

180180
dotnet wix build "${WXS_PATH}" \
181-
-arch "${dotnetarch}" \
181+
-arch "${wixarch}" \
182182
-out "${build_dir}/${msi_name}" \
183183
-bindpath "${files_dir}" \
184-
-d Arch="${dotnetarch}" \
185184
-d Version="${version}" \
186185
-d Otelcol="${otelcol}" \
187186
-d JmxMetricsJar="${jmx_metrics_jar}" \

packaging/msi/splunk-otel-collector.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<Property Id="ARPNOMODIFY" Value="1" />
2020

2121
<!-- Load the Splunk custom actions -->
22-
<Binary Id="SplunkCustomActionsDll" SourceFile="$(sys.SOURCEFILEDIR)/SplunkCustomActions/bin/Release/SplunkCustomActions-$(var.Arch).CA.dll" />
22+
<Binary Id="SplunkCustomActionsDll" SourceFile="$(sys.SOURCEFILEDIR)/SplunkCustomActions/bin/Release/SplunkCustomActions.CA.dll" />
2323
<CustomAction Id="CheckLaunchConditions" DllEntry="CheckLaunchConditions" Execute="immediate" BinaryRef="SplunkCustomActionsDll" />
2424
<CustomAction Id="AddOptionalConfigurationsCustomActionData" Property="AddOptionalConfigurations" Value="GODEBUG=[GODEBUG];GOMEMLIMIT=[GOMEMLIMIT];SPLUNK_COLLECTD_DIR=[SPLUNK_COLLECTD_DIR];SPLUNK_GATEWAY_URL=[SPLUNK_GATEWAY_URL];SPLUNK_LISTEN_INTERFACE=[SPLUNK_LISTEN_INTERFACE];SPLUNK_MEMORY_LIMIT_MIB=[SPLUNK_MEMORY_LIMIT_MIB];SPLUNK_MEMORY_TOTAL_MIB=[SPLUNK_MEMORY_TOTAL_MIB]" />
2525
<CustomAction Id="AddOptionalConfigurations" DllEntry="AddOptionalConfigurations" Execute="deferred" Impersonate="no" BinaryRef="SplunkCustomActionsDll" />

0 commit comments

Comments
 (0)