Skip to content

Commit ded4f95

Browse files
committed
Third attempt
1 parent 4938629 commit ded4f95

File tree

5 files changed

+61
-11
lines changed

5 files changed

+61
-11
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ defaults:
2929
run:
3030
shell: bash
3131

32-
env:
33-
GOPROXY: ${{ github.repository_owner != 'nginx' && 'direct' || (inputs.is_production_release || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && format('https://{0}:{1}@{2}', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN, secrets.ARTIFACTORY_ENDPOINT) || format('https://{0}:{1}@{2}', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN, secrets.ARTIFACTORY_DEV_ENDPOINT) }}
34-
3532
concurrency:
3633
group: ${{ github.ref_name }}-ci
3734
cancel-in-progress: true
@@ -53,6 +50,21 @@ jobs:
5350
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5451
with:
5552
fetch-depth: 0
53+
- name: Configure GOPROXY
54+
id: goproxy
55+
run: |
56+
if [[ "${{ secrets.ARTIFACTORY_USER }}" == "" ]]; then
57+
echo "No Artifactory secrets available - using direct GOPROXY"
58+
GOPROXY_VALUE="direct"
59+
elif [[ "${{ inputs.is_production_release }}" == "true" ]] || [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
60+
echo "Production mode - using production Artifactory"
61+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_ENDPOINT }}"
62+
else
63+
echo "Development mode - using dev Artifactory"
64+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
65+
fi
66+
echo "goproxy=${GOPROXY_VALUE}" >> $GITHUB_OUTPUT
67+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
5668
5769
- name: Setup Golang Environment
5870
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
@@ -92,6 +104,8 @@ jobs:
92104
name: Unit Tests
93105
runs-on: ubuntu-24.04
94106
needs: vars
107+
env:
108+
GOPROXY: ${{ needs.vars.outputs.goproxy }}
95109
steps:
96110
- name: Checkout Repository
97111
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -144,6 +158,8 @@ jobs:
144158
name: Build Binary
145159
runs-on: ${{ github.repository_owner == 'nginx' && (inputs.is_production_release || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && 'ubuntu-24.04-amd64' || 'ubuntu-24.04' }}
146160
needs: [vars, unit-tests, njs-unit-tests]
161+
env:
162+
GOPROXY: ${{ needs.vars.outputs.goproxy }}
147163
permissions:
148164
contents: write # for goreleaser/goreleaser-action and lucacome/draft-release to create/update releases
149165
id-token: write # for goreleaser/goreleaser-action to sign artifacts
@@ -345,6 +361,8 @@ jobs:
345361
name: CEL Tests
346362
runs-on: ubuntu-24.04
347363
needs: vars
364+
env:
365+
GOPROXY: ${{ needs.vars.outputs.goproxy }}
348366
steps:
349367
- name: Checkout Repository
350368
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

.github/workflows/conformance.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ defaults:
2828
env:
2929
PLUS_USAGE_ENDPOINT: ${{ secrets.JWT_PLUS_REPORTING_ENDPOINT }}
3030
ENABLE_EXPERIMENTAL: ${{ inputs.enable-experimental }}
31-
GOPROXY: ${{ github.repository_owner != 'nginx' && 'direct' || format('https://{0}:{1}@{2}', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN, secrets.ARTIFACTORY_DEV_ENDPOINT) }}
3231

3332
permissions:
3433
contents: read
@@ -48,6 +47,16 @@ jobs:
4847
with:
4948
fetch-depth: 0
5049

50+
- name: Configure GOPROXY
51+
id: goproxy
52+
run: |
53+
if [[ "${{ secrets.ARTIFACTORY_USER }}" == "" ]]; then
54+
GOPROXY_VALUE="direct"
55+
else
56+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
57+
fi
58+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
59+
5160
- name: Setup Golang Environment
5261
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
5362
with:

.github/workflows/functional.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ defaults:
1616

1717
env:
1818
PLUS_USAGE_ENDPOINT: ${{ secrets.JWT_PLUS_REPORTING_ENDPOINT }}
19-
GOPROXY: ${{ github.repository_owner != 'nginx' && 'direct' || format('https://{0}:{1}@{2}', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN, secrets.ARTIFACTORY_DEV_ENDPOINT) }}
2019

2120
permissions:
2221
contents: read
@@ -34,6 +33,16 @@ jobs:
3433
with:
3534
fetch-depth: 0
3635

36+
- name: Configure GOPROXY
37+
id: goproxy
38+
run: |
39+
if [[ "${{ secrets.ARTIFACTORY_USER }}" == "" ]]; then
40+
GOPROXY_VALUE="direct"
41+
else
42+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
43+
fi
44+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
45+
3746
- name: Setup Golang Environment
3847
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
3948
with:

.github/workflows/lint.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ defaults:
1212
run:
1313
shell: bash
1414

15-
env:
16-
GOPROXY: ${{ github.repository_owner != 'nginx' && 'direct' || format('https://{0}:{1}@{2}', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN, secrets.ARTIFACTORY_DEV_ENDPOINT) }}
17-
1815
concurrency:
1916
group: ${{ github.ref_name }}-lint
2017
cancel-in-progress: true
@@ -34,6 +31,16 @@ jobs:
3431
- name: Checkout Repository
3532
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3633

34+
- name: Configure GOPROXY
35+
id: goproxy
36+
run: |
37+
if [[ "${{ secrets.ARTIFACTORY_USER }}" == "" ]]; then
38+
GOPROXY_VALUE="direct"
39+
else
40+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
41+
fi
42+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
43+
3744
- name: Setup Golang Environment
3845
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
3946
with:

.github/workflows/renovate-build.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ defaults:
1111
run:
1212
shell: bash
1313

14-
env:
15-
GOPROXY: ${{ github.repository_owner != 'nginx' && 'direct' || format('https://{0}:{1}@{2}', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN, secrets.ARTIFACTORY_DEV_ENDPOINT) }}
16-
1714
concurrency:
1815
group: ${{ github.ref_name }}-renovate
1916
cancel-in-progress: true
@@ -53,6 +50,16 @@ jobs:
5350
with:
5451
ref: ${{ github.head_ref }}
5552

53+
- name: Configure GOPROXY
54+
id: goproxy
55+
run: |
56+
if [[ "${{ secrets.ARTIFACTORY_USER }}" == "" ]]; then
57+
GOPROXY_VALUE="direct"
58+
else
59+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
60+
fi
61+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
62+
5663
- name: Setup Golang Environment
5764
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
5865
with:

0 commit comments

Comments
 (0)