Skip to content

Commit b39c033

Browse files
pdabelf5Rahul Somasundaram
authored andcommitted
Pipeline fixes (nginx#5785)
1 parent 8e531b3 commit b39c033

File tree

3 files changed

+60
-9
lines changed

3 files changed

+60
-9
lines changed

.github/workflows/build-oss.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ on:
2626
type: boolean
2727
full-build:
2828
description: Always build base image
29-
required: false
3029
type: boolean
3130
default: false
3231
ic-version:

.github/workflows/build-plus.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ on:
3232
type: boolean
3333
full-build:
3434
description: Always build base image
35-
required: false
3635
type: boolean
3736
default: false
3837
ic-version:

.github/workflows/image-promotion.yml

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
with:
5050
go-version-file: go.mod
5151

52-
- name: Output Variables
52+
- name: Set Variables
5353
id: vars
5454
run: |
5555
echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
@@ -60,7 +60,6 @@ jobs:
6060
./.github/scripts/variables.sh docker_md5 >> $GITHUB_OUTPUT
6161
./.github/scripts/variables.sh build_tag >> $GITHUB_OUTPUT
6262
./.github/scripts/variables.sh stable_tag >> $GITHUB_OUTPUT
63-
cat $GITHUB_OUTPUT
6463
6564
- name: Fetch Cached Binary Artifacts
6665
id: binary-cache
@@ -92,10 +91,64 @@ jobs:
9291
echo "exists=true" >> $GITHUB_OUTPUT
9392
fi
9493
94+
- name: Output variables
95+
run: |
96+
echo go_code_md5: ${{ steps.vars.outputs.go_code_md5 }}
97+
echo go_path: ${{ steps.vars.outputs.go_path }}
98+
echo binary_cache_hit: ${{ steps.binary-cache.outputs.cache-hit }}
99+
echo chart_version: ${{ steps.vars.outputs.chart_version }}
100+
echo ic_version: ${{ steps.vars.outputs.ic_version }}
101+
echo docker_md5: ${{ steps.vars.outputs.docker_md5 }}
102+
echo build_tag: ${{ steps.vars.outputs.build_tag }}
103+
echo stable_tag: ${{ steps.vars.outputs.stable_tag }}
104+
echo stable_image_exists: ${{ steps.stable_exists.outputs.exists }}
105+
106+
binaries:
107+
name: Build Binaries
108+
runs-on: ubuntu-22.04
109+
needs: [checks]
110+
permissions:
111+
contents: read
112+
steps:
113+
- name: Checkout Repository
114+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
115+
116+
- name: Setup Golang Environment
117+
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
118+
with:
119+
go-version-file: go.mod
120+
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
121+
122+
- name: Build binaries
123+
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
124+
with:
125+
version: latest
126+
args: build --snapshot --clean
127+
env:
128+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129+
GOPATH: ${{ needs.checks.outputs.go_path }}
130+
AWS_PRODUCT_CODE: ${{ secrets.AWS_PRODUCT_CODE }}
131+
AWS_PUB_KEY: ${{ secrets.AWS_PUB_KEY }}
132+
AWS_NAP_DOS_PRODUCT_CODE: ${{ secrets.AWS_NAP_DOS_PRODUCT_CODE }}
133+
AWS_NAP_DOS_PUB_KEY: ${{ secrets.AWS_NAP_DOS_PUB_KEY }}
134+
AWS_NAP_WAF_PRODUCT_CODE: ${{ secrets.AWS_NAP_WAF_PRODUCT_CODE }}
135+
AWS_NAP_WAF_PUB_KEY: ${{ secrets.AWS_NAP_WAF_PUB_KEY }}
136+
AWS_NAP_WAF_DOS_PRODUCT_CODE: ${{ secrets.AWS_NAP_WAF_DOS_PRODUCT_CODE }}
137+
AWS_NAP_WAF_DOS_PUB_KEY: ${{ secrets.AWS_NAP_WAF_DOS_PUB_KEY }}
138+
GORELEASER_CURRENT_TAG: "v${{ needs.checks.outputs.ic_version }}"
139+
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
140+
141+
- name: Store Artifacts in Cache
142+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
143+
with:
144+
path: ${{ github.workspace }}/dist
145+
key: nginx-ingress-${{ needs.checks.outputs.go_code_md5 }}
146+
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' }}
147+
95148
build-docker:
96149
if: ${{ needs.checks.outputs.stable_image_exists != 'true' }}
97150
name: Build Docker OSS
98-
needs: [checks]
151+
needs: [checks, binaries]
99152
strategy:
100153
fail-fast: false
101154
matrix:
@@ -125,7 +178,7 @@ jobs:
125178
build-docker-plus:
126179
if: ${{ needs.checks.outputs.stable_image_exists != 'true' }}
127180
name: Build Docker Plus
128-
needs: [checks]
181+
needs: [checks, binaries]
129182
strategy:
130183
fail-fast: false
131184
matrix:
@@ -157,7 +210,7 @@ jobs:
157210
build-docker-nap:
158211
if: ${{ needs.checks.outputs.stable_image_exists != 'true' }}
159212
name: Build Docker NAP
160-
needs: [checks]
213+
needs: [checks, binaries]
161214
strategy:
162215
fail-fast: false
163216
matrix:
@@ -302,8 +355,8 @@ jobs:
302355
uses: ./.github/workflows/publish-helm.yml
303356
with:
304357
branch: ${{ github.ref_name }}
305-
ic_version: 0.0.0-edge
306-
chart_version: edge
358+
ic_version: edge
359+
chart_version: 0.0.0-edge
307360
nginx_helm_repo: false
308361
permissions:
309362
contents: write # for pushing to Helm Charts repository

0 commit comments

Comments
 (0)