4
4
push :
5
5
branches :
6
6
- main
7
+ - release-*
7
8
tags :
8
9
- ' v[0-9]+.[0-9]+.[0-9]+'
9
10
pull_request :
@@ -31,28 +32,31 @@ jobs:
31
32
name : Checks and variables
32
33
runs-on : ubuntu-22.04
33
34
outputs :
34
- go_path : ${{ steps.go .outputs.go_path }}
35
+ go_path : ${{ steps.vars .outputs.go_path }}
35
36
k8s_latest : ${{ steps.vars.outputs.k8s_latest }}
37
+ chart_version : ${{ steps.vars.outputs.chart_version }}
36
38
steps :
37
39
- name : Checkout Repository
38
40
uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
39
- - name : Output Variables
40
- id : vars
41
- run : |
42
- echo "k8s_latest=$(grep -m1 'FROM kindest/node' <tests/docker/Dockerfile | awk -F'[:v]' '{print $3}')" >> $GITHUB_OUTPUT
41
+
43
42
- name : Setup Golang Environment
44
43
uses : actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
45
44
with :
46
45
go-version-file : go.mod
47
- - name : Determine GOPATH
48
- id : go
49
- run : echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
50
- - name : Check if go.mod and go.sum are up to date
46
+
47
+ - name : Output Variables
48
+ id : vars
51
49
run : |
52
- go mod tidy && git diff --exit-code -- go.mod go.sum
50
+ echo "k8s_latest=$(grep -m1 'FROM kindest/node' <tests/docker/Dockerfile | awk -F'[:v]' '{print $3}')" >> $GITHUB_OUTPUT
51
+ echo "chart_version=$(yq '.version' <deployments/helm-chart/Chart.yaml)" >> $GITHUB_OUTPUT
52
+ echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
53
+
54
+ - name : Check if go.mod and go.sum are up to date
55
+ run : go mod tidy && git diff --exit-code -- go.mod go.sum
56
+
53
57
- name : Check if CRDs changed
54
- run : |
55
- make update-crds && git diff --name-only --exit-code deployments/common/crds* deployments/helm-chart/crds*
58
+ run : make update-crds && git diff --name-only --exit-code deployments/common/crds* deployments/helm-chart/crds*
59
+
56
60
- name : Check if Codegen changed
57
61
run : |
58
62
cd ../.. && mkdir -p github.com/nginxinc && mv kubernetes-ingress/kubernetes-ingress github.com/nginxinc/ && cd github.com/nginxinc/kubernetes-ingress
@@ -78,10 +82,33 @@ jobs:
78
82
files : ./coverage.txt
79
83
80
84
release :
81
- name : Release
82
- if : startsWith(github.ref, 'refs/tags/')
83
- uses : ./.github/workflows/release.yml
84
- secrets : inherit
85
+ runs-on : ubuntu-22.04
86
+ needs : [checks, unit-tests]
87
+ if : ${{ github.event_name == 'push' && ! github.ref != 'refs/heads/main' }}
88
+ steps :
89
+ - name : Checkout Repository
90
+ uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
91
+
92
+ - name : Create/Update Draft
93
+ uses : lucacome/draft-release@b79be3ff634f771230b2b6ee9f47308c5793671a # v0.2.0
94
+ with :
95
+ minor-label : ' enhancement'
96
+ major-label : ' change'
97
+ publish : ${{ startsWith(github.ref, 'refs/tags/') }}
98
+ collapse-after : 50
99
+ variables : |
100
+ helm-chart=${{ needs.checks.outputs.chart_version }}
101
+ notes-footer : |
102
+ ## Upgrade
103
+ - For NGINX, use the {{version}} image from our [DockerHub](https://hub.docker.com/r/nginx/nginx-ingress/tags?page=1&ordering=last_updated&name={{version-number}}), [GitHub Container](https://github.com/nginxinc/kubernetes-ingress/pkgs/container/kubernetes-ingress), [Amazon ECR Public Gallery](https://gallery.ecr.aws/nginx/nginx-ingress) or [Quay.io](https://quay.io/repository/nginx/nginx-ingress).
104
+ - For NGINX Plus, use the {{version}} image from the F5 Container registry or the [AWS Marketplace](https://aws.amazon.com/marketplace/search/?CREATOR=741df81b-dfdc-4d36-b8da-945ea66b522c&FULFILLMENT_OPTION_TYPE=CONTAINER&filters=CREATOR%2CFULFILLMENT_OPTION_TYPE) or build your own image using the {{version}} source code.
105
+ - For Helm, use version {{helm-chart}} of the chart.
106
+
107
+ ## Resources
108
+ - Documentation -- https://docs.nginx.com/nginx-ingress-controller/
109
+ - Configuration examples -- https://github.com/nginxinc/kubernetes-ingress/tree/{{version}}/examples
110
+ - Helm Chart -- https://github.com/nginxinc/kubernetes-ingress/tree/{{version}}/deployments/helm-chart
111
+ - Operator -- https://github.com/nginxinc/nginx-ingress-operator/
85
112
86
113
binaries :
87
114
name : Build Binaries
@@ -106,7 +133,7 @@ jobs:
106
133
uses : goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
107
134
with :
108
135
version : latest
109
- args : ${{ startsWith(github.ref, 'refs/tags/') && 'release' || 'build --snapshot' }} ${{ github.event_name == 'pull_request' && '--single-target' || '' }} --rm-dist
136
+ args : ${{ startsWith(github.ref, 'refs/tags/') && 'release' || 'build --snapshot' }} ${{ github.event_name == 'pull_request' && '--single-target' || '' }} --clean
110
137
env :
111
138
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
112
139
GOPATH : ${{ needs.checks.outputs.go_path }}
@@ -210,7 +237,6 @@ jobs:
210
237
name : Setup Matrix for Smoke Tests
211
238
runs-on : ubuntu-22.04
212
239
needs : [checks, binaries]
213
- if : ${{ ! startsWith(github.ref, 'refs/tags/') }}
214
240
outputs :
215
241
matrix : ${{ steps.set-matrix.outputs.matrix }}
216
242
steps :
@@ -336,8 +362,8 @@ jobs:
336
362
publish-helm :
337
363
name : Package and Publish Helm Chart
338
364
runs-on : ubuntu-22.04
339
- needs : helm-tests
340
- if : ${{ github.event_name == 'push' }}
365
+ needs : [checks, helm-tests]
366
+ if : ${{ github.event_name == 'push' && ! startsWith(github.ref, 'refs/heads/release-') }}
341
367
steps :
342
368
- name : Checkout Repository
343
369
uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
@@ -375,22 +401,15 @@ jobs:
375
401
fetch-depth : 1
376
402
token : ${{ secrets.NGINX_PAT }}
377
403
path : helm-charts
378
-
379
- - name : Get Chart type
380
- id : package-helm
381
- run : |
382
- echo "type=${{ contains(steps.package.outputs.path, 'edge') && 'edge' || 'stable' }}" >> $GITHUB_OUTPUT
383
-
384
- - name : Remove previous Chart
385
- if : ${{ ! startsWith(github.ref, 'refs/tags/') }}
386
- run : rm -f ${{ github.workspace }}/helm-charts/edge/nginx-ingress-0.0.0-edge.tgz
404
+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
387
405
388
406
- name : Push Helm Chart to Helm Charts Repository
389
407
run : |
390
- mv ${{ steps.package.outputs.path }} ${{ github.workspace }}/helm-charts/${{ steps.package-helm.outputs.type }} /
408
+ mv ${{ steps.package.outputs.path }} ${{ github.workspace }}/helm-charts/stable /
391
409
cd ${{ github.workspace }}/helm-charts
392
- helm repo index ${{ steps.package-helm.outputs.type }} -- url https://helm.nginx.com/${{ steps.package-helm.outputs.type }}
410
+ helm repo index stable -- url https://helm.nginx.com/stable
393
411
git add -A
394
412
git -c user.name='NGINX Kubernetes Team' -c user.email='[email protected] ' \
395
- commit -m "NGINX Ingress Controller - Release ${{ steps.package-helm .outputs.type }} ${{ steps.package-helm.outputs.version }}"
413
+ commit -m "NGINX Ingress Controller - Release ${{ needs.checks .outputs.chart_version }}"
396
414
git push -u origin master
415
+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
0 commit comments