Skip to content

Add GOPROXY to binary builds #8053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
k8s_latest: ${{ steps.vars.outputs.k8s_latest }}
go_path: ${{ steps.vars.outputs.go_path }}
go_code_md5: ${{ steps.vars.outputs.go_code_md5 }}
go_proxy: ${{ steps.vars.outputs.go_proxy }}
binary_cache_hit: ${{ steps.binary-cache.outputs.cache-hit }}
chart_version: ${{ steps.vars.outputs.chart_version }}
ic_version: ${{ steps.vars.outputs.ic_version }}
Expand Down Expand Up @@ -98,7 +99,13 @@ jobs:
source .github/data/version.txt
echo "ic_version=${IC_VERSION}" >> $GITHUB_OUTPUT
echo "chart_version=${HELM_CHART_VERSION}" >> $GITHUB_OUTPUT
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
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' }}
echo "forked_workflow=${forked_workflow}" >> $GITHUB_OUTPUT
go_proxy="https://proxy.golang.org,direct"
if [ "$forked_workflow" = "false" ]; then
go_proxy="https://azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev"
fi
echo "go_proxy=${go_proxy}" >> $GITHUB_OUTPUT
./.github/scripts/variables.sh go_code_md5 >> $GITHUB_OUTPUT
./.github/scripts/variables.sh docker_md5 >> $GITHUB_OUTPUT
./.github/scripts/variables.sh build_tag >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -173,6 +180,8 @@ jobs:
permissions:
contents: read
needs: checks
env:
GOPROXY: ${{ needs.checks.outputs.go_proxy }}
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -183,6 +192,16 @@ jobs:
go-version-file: go.mod
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}

- name: Setup netrc
run: |
cat <<EOF > $HOME/.netrc
machine azr.artifactory.f5net.com
login ${{ secrets.ARTIFACTORY_USER }}
password ${{ secrets.ARTIFACTORY_TOKEN }}
EOF
chmod 600 $HOME/.netrc
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true' }}

- name: Check if go.mod and go.sum are up to date
run: go mod tidy && git diff --exit-code -- go.mod go.sum
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
Expand Down Expand Up @@ -212,6 +231,8 @@ jobs:
name: Unit Tests
runs-on: ubuntu-22.04
needs: checks
env:
GOPROXY: ${{ needs.checks.outputs.go_proxy }}
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -222,6 +243,16 @@ jobs:
go-version-file: go.mod
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' && (inputs.run_tests && inputs.run_tests || true) }}

- name: Setup netrc
run: |
cat <<EOF > $HOME/.netrc
machine azr.artifactory.f5net.com
login ${{ secrets.ARTIFACTORY_USER }}
password ${{ secrets.ARTIFACTORY_TOKEN }}
EOF
chmod 600 $HOME/.netrc
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true' }}

- name: Run Tests
run: make cover
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' && (inputs.run_tests && inputs.run_tests || true) }}
Expand Down Expand Up @@ -260,6 +291,16 @@ jobs:
go-version-file: go.mod
if: ${{ (inputs.force && inputs.force || false) || needs.checks.outputs.binary_cache_hit != 'true' }}

- name: Setup netrc
run: |
cat <<EOF > $HOME/.netrc
machine azr.artifactory.f5net.com
login ${{ secrets.ARTIFACTORY_USER }}
password ${{ secrets.ARTIFACTORY_TOKEN }}
EOF
chmod 600 $HOME/.netrc
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true' }}

- name: Build binaries
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
with:
Expand All @@ -268,6 +309,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPATH: ${{ needs.checks.outputs.go_path }}
GOPROXY: ${{ needs.checks.outputs.go_proxy }}
AWS_PRODUCT_CODE: ${{ secrets.AWS_PRODUCT_CODE }}
AWS_PUB_KEY: ${{ secrets.AWS_PUB_KEY }}
AWS_NAP_DOS_PRODUCT_CODE: ${{ secrets.AWS_NAP_DOS_PRODUCT_CODE }}
Expand Down
26 changes: 25 additions & 1 deletion .github/workflows/image-promotion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
outputs:
go_path: ${{ steps.vars.outputs.go_path }}
go_code_md5: ${{ steps.vars.outputs.go_code_md5 }}
go_proxy: ${{ steps.vars.outputs.go_proxy }}
binary_cache_hit: ${{ steps.binary-cache.outputs.cache-hit }}
chart_version: ${{ steps.vars.outputs.chart_version }}
ic_version: ${{ steps.vars.outputs.ic_version }}
Expand All @@ -58,7 +59,7 @@ jobs:
- name: Set Variables
id: vars
run: |
echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
echo "go_proxy="https://azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev" >> $GITHUB_OUTPUT
source .github/data/version.txt
echo "ic_version=${IC_VERSION}" >> $GITHUB_OUTPUT
echo "chart_version=${HELM_CHART_VERSION}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -118,6 +119,9 @@ jobs:
permissions:
contents: read
security-events: write
needs: [checks]
env:
GOPROXY: ${{ needs.checks.outputs.go_proxy }}
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -127,6 +131,15 @@ jobs:
with:
go-version-file: go.mod

- name: Setup netrc
run: |
cat <<EOF > $HOME/.netrc
machine azr.artifactory.f5net.com
login ${{ secrets.ARTIFACTORY_USER }}
password ${{ secrets.ARTIFACTORY_TOKEN }}
EOF
chmod 600 $HOME/.netrc

- name: govulncheck
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4
with:
Expand Down Expand Up @@ -164,6 +177,16 @@ jobs:
go-version-file: go.mod
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}

- name: Setup netrc
run: |
cat <<EOF > $HOME/.netrc
machine azr.artifactory.f5net.com
login ${{ secrets.ARTIFACTORY_USER }}
password ${{ secrets.ARTIFACTORY_TOKEN }}
EOF
chmod 600 $HOME/.netrc
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}

- name: Build binaries
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
with:
Expand All @@ -172,6 +195,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPATH: ${{ needs.checks.outputs.go_path }}
GOPROXY: ${{ needs.checks.outputs.go_proxy }}
AWS_PRODUCT_CODE: ${{ secrets.AWS_PRODUCT_CODE }}
AWS_PUB_KEY: ${{ secrets.AWS_PUB_KEY }}
AWS_NAP_DOS_PRODUCT_CODE: ${{ secrets.AWS_NAP_DOS_PRODUCT_CODE }}
Expand Down