1212 goarch :
1313 required : true
1414 type : string
15+ runner_os :
16+ required : false
17+ type : string
18+ default : ubuntu-24.04
1519
1620env :
1721 # renovate: datasource=github-tags depName=goreleaser-pro packageName=goreleaser/goreleaser-pro
@@ -21,26 +25,18 @@ jobs:
2125 prepare :
2226 strategy :
2327 matrix :
24- GOOS : ${{ fromJSON( inputs.goos) }}
25- GOARCH : ${{ fromJSON( inputs.goarch) }}
28+ GOOS : ${{ fromJSON(inputs.goos) }}
29+ GOARCH : ${{ fromJSON(inputs.goarch) }}
2630 exclude :
2731 - GOOS : darwin
2832 GOARCH : " 386"
2933 - GOOS : darwin
3034 GOARCH : s390x
31- - GOOS : windows
32- GOARCH : arm64
3335 - GOOS : darwin
34- GOARCH : arm
35- - GOOS : windows
36- GOARCH : arm
37- - GOOS : windows
38- GOARCH : s390x
39- - GOOS : darwin
40- GOARCH : ppc64le
41- - GOOS : windows
4236 GOARCH : ppc64le
43- runs-on : ubuntu-24.04
37+ - GOOS : darwin
38+ GOARCH : arm
39+ runs-on : ${{ inputs.runner_os }}
4440
4541 steps :
4642 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -52,22 +48,28 @@ jobs:
5248 - uses : anchore/sbom-action/download-syft@f325610c9f50a54015d37c8d16cb3b0e2c8f4de0 # v0.18.0
5349
5450 - uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
51+ if : runner.os != 'Windows'
5552 with :
5653 platforms : arm64,ppc64le,linux/arm/v7,s390x
5754
5855 - uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
56+ if : runner.os != 'Windows'
57+
58+ # Fix slow Go compile and cache restore
59+ # See https://github.com/actions/setup-go/pull/515
60+ - name : Fix slow setup-go cache restore in Windows
61+ if : runner.os == 'Windows'
62+ run : |
63+ echo "GOCACHE=D:\gocache" | Out-File -FilePath $env:GITHUB_ENV -Append
64+ echo "GOMODCACHE=D:\gomodcache" | Out-File -FilePath $env:GITHUB_ENV -Append
65+ echo "GOTMPDIR=D:\gotmp" | Out-File -FilePath $env:GITHUB_ENV -Append
66+ mkdir D:\gotmp
5967
6068 - uses : actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
6169 with :
6270 go-version : " ~1.24"
6371 check-latest : true
6472
65- - name : Setup wixl # Required to build MSI packages for Windows
66- if : ${{ matrix.GOOS == 'windows' && ( matrix.GOARCH == '386' || matrix.GOARCH == 'amd64') }}
67- run : |
68- sudo apt-get update
69- sudo apt-get install -y wixl
70-
7173 - name : Generate distribution sources
7274 run : make generate-sources
7375
@@ -115,10 +117,14 @@ jobs:
115117 if : inputs.distribution == 'otelcol-contrib'
116118 run : mv distributions/otelcol-contrib/dist/**/* distributions/otelcol-contrib/artifacts/
117119
118- - name : Show built or downloaded content
119- if : inputs.distribution == 'otelcol-contrib'
120+ - name : Show built or downloaded content (Linux)
121+ if : inputs.distribution == 'otelcol-contrib' && runner.os != 'Windows'
120122 run : ls -laR distributions/otelcol-contrib/artifacts
121123
124+ - name : Show built or downloaded content (Windows)
125+ if : inputs.distribution == 'otelcol-contrib' && runner.os == 'Windows'
126+ run : ls -Path distributions/otelcol-contrib/artifacts -Force -Recurse | Format-List
127+
122128 - uses : goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
123129 with :
124130 distribution : goreleaser-pro
@@ -141,7 +147,7 @@ jobs:
141147
142148 release :
143149 name : ${{ inputs.distribution }} Release
144- runs-on : ubuntu-24.04
150+ runs-on : ${{ inputs.runner_os }}
145151 needs : prepare
146152
147153 permissions :
@@ -159,25 +165,57 @@ jobs:
159165 - uses : anchore/sbom-action/download-syft@f325610c9f50a54015d37c8d16cb3b0e2c8f4de0 # v0.18.0
160166
161167 - uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
168+ if : runner.os != 'Windows'
162169 with :
163170 platforms : arm64,ppc64le,s390x
164171
165172 - uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
173+ if : runner.os != 'Windows'
174+
175+ # Fix slow Go compile and cache restore
176+ # See https://github.com/actions/setup-go/pull/515
177+ - name : Fix slow setup-go cache restore in Windows
178+ if : runner.os == 'Windows'
179+ run : |
180+ echo "GOCACHE=D:\gocache" | Out-File -FilePath $env:GITHUB_ENV -Append
181+ echo "GOMODCACHE=D:\gomodcache" | Out-File -FilePath $env:GITHUB_ENV -Append
182+ echo "GOTMPDIR=D:\gotmp" | Out-File -FilePath $env:GITHUB_ENV -Append
183+ mkdir D:\gotmp
166184
167185 - uses : actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
168186 with :
169187 go-version : " ~1.24"
170188 check-latest : true
171189
172190 - uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
191+ if : runner.os == 'Windows'
192+ with :
193+ pattern : artifacts-${{ inputs.distribution }}-windows-*
194+ path : distributions/${{ inputs.distribution }}/dist
195+ merge-multiple : true
196+
197+ - uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
198+ if : runner.os != 'Windows'
173199 with :
174- pattern : artifacts-${{ inputs.distribution }}-*
200+ pattern : artifacts-${{ inputs.distribution }}-darwin-*
201+ path : distributions/${{ inputs.distribution }}/dist
202+ merge-multiple : true
203+
204+ - uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
205+ if : runner.os != 'Windows'
206+ with :
207+ pattern : artifacts-${{ inputs.distribution }}-linux-*
175208 path : distributions/${{ inputs.distribution }}/dist
176209 merge-multiple : true
177210
178211 - name : Display structure of downloaded files
212+ if : runner.os != 'Windows'
179213 run : ls -R distributions/${{ inputs.distribution }}/dist
180214
215+ - name : Display structure of downloaded files (Windows)
216+ if : runner.os == 'Windows'
217+ run : ls -Path distributions/${{ inputs.distribution }}/dist -Force -Recurse | Format-List
218+
181219 - name : Log into Docker.io
182220 uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
183221 with :
0 commit comments