43
43
k8s_latest : ${{ steps.vars.outputs.k8s_latest }}
44
44
go_path : ${{ steps.vars.outputs.go_path }}
45
45
go_code_md5 : ${{ steps.vars.outputs.go_code_md5 }}
46
+ go_proxy : ${{ steps.vars.outputs.go_proxy }}
46
47
binary_cache_hit : ${{ steps.binary-cache.outputs.cache-hit }}
47
48
chart_version : ${{ steps.vars.outputs.chart_version }}
48
49
ic_version : ${{ steps.vars.outputs.ic_version }}
98
99
source .github/data/version.txt
99
100
echo "ic_version=${IC_VERSION}" >> $GITHUB_OUTPUT
100
101
echo "chart_version=${HELM_CHART_VERSION}" >> $GITHUB_OUTPUT
101
- echo "forked_workflow=${{ (github.event.pull_request && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) || github.repository != 'nginx/kubernetes-ingress' }}" >> $GITHUB_OUTPUT
102
+ forked_workflow=${{ (github.event.pull_request && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) || github.repository != 'nginx/kubernetes-ingress' }}
103
+ echo "forked_workflow=${forked_workflow}" >> $GITHUB_OUTPUT
104
+ go_proxy="https://proxy.golang.org,direct"
105
+ if [ "$forked_workflow" = "false" ]; then
106
+ go_proxy="https://azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev"
107
+ fi
108
+ echo "go_proxy=${go_proxy}" >> $GITHUB_OUTPUT
102
109
./.github/scripts/variables.sh go_code_md5 >> $GITHUB_OUTPUT
103
110
./.github/scripts/variables.sh docker_md5 >> $GITHUB_OUTPUT
104
111
./.github/scripts/variables.sh build_tag >> $GITHUB_OUTPUT
@@ -173,6 +180,8 @@ jobs:
173
180
permissions :
174
181
contents : read
175
182
needs : checks
183
+ env :
184
+ GOPROXY : ${{ needs.checks.outputs.go_proxy }}
176
185
steps :
177
186
- name : Checkout Repository
178
187
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -183,6 +192,16 @@ jobs:
183
192
go-version-file : go.mod
184
193
if : ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
185
194
195
+ - name : Setup netrc
196
+ run : |
197
+ cat <<EOF > $HOME/.netrc
198
+ machine azr.artifactory.f5net.com
199
+ login ${{ secrets.ARTIFACTORY_USER }}
200
+ password ${{ secrets.ARTIFACTORY_TOKEN }}
201
+ EOF
202
+ chmod 600 $HOME/.netrc
203
+ if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true' }}
204
+
186
205
- name : Check if go.mod and go.sum are up to date
187
206
run : go mod tidy && git diff --exit-code -- go.mod go.sum
188
207
if : ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
@@ -212,6 +231,8 @@ jobs:
212
231
name : Unit Tests
213
232
runs-on : ubuntu-22.04
214
233
needs : checks
234
+ env :
235
+ GOPROXY : ${{ needs.checks.outputs.go_proxy }}
215
236
steps :
216
237
- name : Checkout Repository
217
238
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -222,6 +243,16 @@ jobs:
222
243
go-version-file : go.mod
223
244
if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
224
245
246
+ - name : Setup netrc
247
+ run : |
248
+ cat <<EOF > $HOME/.netrc
249
+ machine azr.artifactory.f5net.com
250
+ login ${{ secrets.ARTIFACTORY_USER }}
251
+ password ${{ secrets.ARTIFACTORY_TOKEN }}
252
+ EOF
253
+ chmod 600 $HOME/.netrc
254
+ if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true' }}
255
+
225
256
- name : Run Tests
226
257
run : make cover
227
258
if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
@@ -260,6 +291,16 @@ jobs:
260
291
go-version-file : go.mod
261
292
if : ${{ (inputs.force && inputs.force || false) || needs.checks.outputs.binary_cache_hit != 'true' }}
262
293
294
+ - name : Setup netrc
295
+ run : |
296
+ cat <<EOF > $HOME/.netrc
297
+ machine azr.artifactory.f5net.com
298
+ login ${{ secrets.ARTIFACTORY_USER }}
299
+ password ${{ secrets.ARTIFACTORY_TOKEN }}
300
+ EOF
301
+ chmod 600 $HOME/.netrc
302
+ if : ${{ needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true' }}
303
+
263
304
- name : Build binaries
264
305
uses : goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
265
306
with :
@@ -268,6 +309,7 @@ jobs:
268
309
env :
269
310
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
270
311
GOPATH : ${{ needs.checks.outputs.go_path }}
312
+ GOPROXY : ${{ needs.checks.outputs.go_proxy }}
271
313
AWS_PRODUCT_CODE : ${{ secrets.AWS_PRODUCT_CODE }}
272
314
AWS_PUB_KEY : ${{ secrets.AWS_PUB_KEY }}
273
315
AWS_NAP_DOS_PRODUCT_CODE : ${{ secrets.AWS_NAP_DOS_PRODUCT_CODE }}
0 commit comments