@@ -32,222 +32,63 @@ env:
32
32
GO_VERSION : 1.23.10
33
33
34
34
jobs :
35
- setup-environment :
36
- runs-on : ubuntu-24.04
37
- needs : lint
38
- steps :
39
- - name : Check out the codebase.
40
- uses : actions/checkout@v4
41
-
42
- - name : Set up Go
43
- uses : actions/setup-go@v5
44
- with :
45
- go-version : ${{ env.GO_VERSION }}
46
- cache-dependency-path : ' **/go.sum'
47
-
48
- - name : Installing dependency
49
- run : |
50
- make install-tools
51
-
52
35
cross-compile :
53
- runs-on : ubuntu-24.04
54
- needs : [ setup-environment ]
55
36
strategy :
56
37
matrix :
57
- SYS_BINARIES : [ "binaries-linux_amd64", "binaries-linux_arm64", "binaries-linux_ppc64le", "binaries-windows_amd64" ]
58
- steps :
59
- - name : Check out the codebase.
60
- uses : actions/checkout@v4
61
-
62
- - name : Set up Go
63
- uses : actions/setup-go@v5
64
- with :
65
- go-version : ${{ env.GO_VERSION }}
66
- cache-dependency-path : ' **/go.sum'
67
-
68
- - name : Build Collector
69
- run : |
70
- make ${{ matrix.SYS_BINARIES }}
71
-
72
- - name : Uploading binaries
73
- uses : actions/upload-artifact@v4
74
- with :
75
- name : ${{ matrix.SYS_BINARIES }}
76
- path : |
77
- ./bin/*
38
+ SYS_BINARIES : [ "binaries-linux_amd64", "binaries-linux_arm64", "binaries-linux_ppc64le" ]
39
+ uses : ./.github/workflows/compile.yml
40
+ with :
41
+ SYS_BINARY : ${{ matrix.SYS_BINARIES }}
78
42
79
43
agent-bundle-linux :
80
- runs-on : ${{ fromJSON('["ubuntu-24.04", "otel-arm64"]')[matrix.ARCH == 'arm64'] }}
81
- needs : lint
82
44
strategy :
83
45
matrix :
84
46
ARCH : [ "amd64", "arm64" ]
85
47
fail-fast : false
86
- steps :
87
- - uses : actions/checkout@v4
88
-
89
- - uses : actions/cache@v4
90
- id : bundle-cache
91
- with :
92
- path : .cache/buildx/agent-bundle-${{ matrix.ARCH }}
93
- key : agent-bundle-buildx-${{ matrix.ARCH }}-${{ hashFiles('packaging/bundle/**') }}
94
- restore-keys : |
95
- agent-bundle-buildx-${{ matrix.ARCH }}-
96
-
97
- - run : make -C packaging/bundle agent-bundle-linux ARCH=${{ matrix.ARCH }}
98
- env :
99
- BUNDLE_CACHE_HIT : " ${{ steps.bundle-cache.outputs.cache-hit }}"
100
-
101
- - uses : actions/upload-artifact@v4
102
- with :
103
- name : agent-bundle-linux-${{ matrix.ARCH }}
104
- path : ./dist/agent-bundle_linux_${{ matrix.ARCH }}.tar.gz
48
+ uses : ./.github/workflows/agent-bundle-linux.yml
49
+ with :
50
+ ARCH : ${{ matrix.ARCH }}
105
51
106
52
build-package :
107
- runs-on : ubuntu-24.04
108
53
needs : [ cross-compile, agent-bundle-linux ]
109
54
strategy :
110
55
matrix :
111
56
SYS_PACKAGE : [ "deb", "rpm", "tar" ]
112
57
ARCH : [ "amd64", "arm64" ]
113
58
fail-fast : false
114
- steps :
115
- - name : Check out the codebase.
116
- uses : actions/checkout@v4
117
- with :
118
- fetch-depth : 0
119
-
120
- - name : Set up Go
121
- uses : actions/setup-go@v5
122
- with :
123
- go-version : ${{ env.GO_VERSION }}
124
- cache-dependency-path : ' **/go.sum'
125
-
126
- - name : Downloading binaries-linux_${{ matrix.ARCH }}
127
- uses : actions/download-artifact@v4
128
- with :
129
- name : binaries-linux_${{ matrix.ARCH }}
130
- path : ./bin
131
-
132
- - uses : actions/download-artifact@v4
133
- with :
134
- name : agent-bundle-linux-${{ matrix.ARCH }}
135
- path : ./dist
136
-
137
- - name : Build ${{ matrix.SYS_PACKAGE }} ${{ matrix.ARCH }} package
138
- run : make ${{ matrix.SYS_PACKAGE }}-package SKIP_COMPILE=true SKIP_BUNDLE=true VERSION="" ARCH="${{ matrix.ARCH }}"
139
-
140
- - name : Uploading ${{ matrix.SYS_PACKAGE }} ${{ matrix.ARCH }} package artifacts
141
- uses : actions/upload-artifact@v4
142
- with :
143
- name : ${{ matrix.SYS_PACKAGE }}-${{ matrix.ARCH }}-package
144
- path : ./dist/splunk-otel-collector*
59
+ uses : ./.github/workflows/build-package.yml
60
+ with :
61
+ SYS_PACKAGE : ${{ matrix.SYS_PACKAGE }}
62
+ ARCH : ${{ matrix.ARCH }}
145
63
146
64
agent-bundle-windows :
147
65
needs : lint
148
66
runs-on : ${{ matrix.OS }}
149
67
strategy :
150
68
matrix :
151
69
OS : [ "windows-2025" ]
152
- env :
70
+ uses : ./.github/workflows/agent-bundle-windows.yml
71
+ with :
72
+ OS : ${{ matrix.OS }}
153
73
PIP_CACHE_DIR : ${{ github.workspace }}/.cache/pip
154
- steps :
155
- - uses : actions/checkout@v4
156
-
157
- - uses : actions/cache@v4
158
- with :
159
- path : ${{ env.PIP_CACHE_DIR }}
160
- key : agent-bundle-windows-pip-${{ hashFiles('packaging/bundle/collectd-plugins.yaml', 'packaging/bundle/scripts/requirements.txt') }}
161
-
162
- - run : ./packaging/bundle/scripts/windows/make.ps1 bundle
163
-
164
- - uses : actions/upload-artifact@v4
165
- with :
166
- name : agent-bundle-windows-${{ matrix.OS }}
167
- path : ./dist/agent-bundle_windows_amd64.zip
168
74
169
75
msi-custom-actions :
170
- runs-on : windows-2025
171
76
needs : lint
172
- steps :
173
- - name : Check out the codebase.
174
- uses : actions/checkout@v4
175
-
176
- - name : Uninstall default WiX
177
- run : choco uninstall wixtoolset
178
-
179
- - name : Install WiX 3.14.0
180
- run : choco install wixtoolset --version 3.14.0 --allow-downgrade --force
181
-
182
- - name : Build Custom Actions
183
- working-directory : packaging/msi/SplunkCustomActions
184
- run : |
185
- dotnet test ./test/SplunkCustomActionsTests.csproj -c Release
186
- dotnet publish ./src/SplunkCustomActions.csproj -c Release -o ./bin/Release
187
-
188
- - name : Package Custom Actions
189
- run : |
190
- $WixPath = "${Env:ProgramFiles(x86)}\WiX Toolset v3.14"
191
- $sfxcaDll = "${WixPath}\SDK\x64\sfxca.dll"
192
- $Env:PATH = "${WixPath}\SDK;" + $Env:PATH
193
- $customActionDir = "${PWD}\packaging\msi\SplunkCustomActions"
194
- $customActionBinDir = "${customActionDir}\bin\Release"
195
- MakeSfxCA.exe "${PWD}\dist\SplunkCustomActions.CA.dll" `
196
- "${sfxcaDll}" `
197
- "${customActionBinDir}\SplunkCustomActions.dll" `
198
- "${customActionBinDir}\Microsoft.Deployment.WindowsInstaller.dll" `
199
- "${customActionDir}\src\CustomAction.config"
200
-
201
- - uses : actions/upload-artifact@v4
202
- with :
203
- name : msi-custom-actions
204
- path : ./dist/SplunkCustomActions.CA.dll
77
+ strategy :
78
+ matrix :
79
+ OS : [ "windows-2025" ]
80
+ uses : ./.github/workflows/msi-custom-actions.yml
81
+ with :
82
+ OS : ${{ matrix.OS }}
205
83
206
84
msi-build :
207
- runs-on : ubuntu-24.04
208
- env :
209
- WINDOWS_VER : " windows-2025"
210
85
needs : [cross-compile, agent-bundle-windows, msi-custom-actions]
211
- steps :
212
- - name : Check out the codebase.
213
- uses : actions/checkout@v4
214
- with :
215
- fetch-depth : 0
216
-
217
- - name : Downloading binaries-windows_amd64
218
- uses : actions/download-artifact@v4
219
- with :
220
- name : binaries-windows_amd64
221
- path : ./bin
222
-
223
- - name : Set up Go
224
- uses : actions/setup-go@v5
225
- with :
226
- go-version : ${{ env.GO_VERSION }}
227
- cache-dependency-path : ' **/go.sum'
228
-
229
- - name : Downloading agent-bundle-windows
230
- uses : actions/download-artifact@v4
231
- with :
232
- name : agent-bundle-windows-${{ env.WINDOWS_VER }}
233
- path : ./dist
234
-
235
- - name : Downloading msi-custom-actions
236
- uses : actions/download-artifact@v4
237
- with :
238
- name : msi-custom-actions
239
- path : ./packaging/msi/SplunkCustomActions/bin/Release
240
-
241
- - name : Build MSI
242
- run : |
243
- mkdir -p dist
244
- make msi SKIP_COMPILE=true VERSION=""
245
-
246
- - name : Uploading msi build artifacts
247
- uses : actions/upload-artifact@v4
248
- with :
249
- name : msi-build
250
- path : ./dist/*.msi
86
+ strategy :
87
+ matrix :
88
+ OS : [ "windows-2025" ]
89
+ uses : ./.github/workflows/msi-build.yml
90
+ with :
91
+ OS : ${{ matrix.OS }}
251
92
252
93
lint :
253
94
name : Lint
0 commit comments