Skip to content

Commit 233aed8

Browse files
authored
Merge branch 'main' into feat/pipeline-certfication-testing
2 parents 3487c97 + 56b60b9 commit 233aed8

File tree

107 files changed

+1968
-922
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1968
-922
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: Checkout Repository
5656
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5757
with:
58-
ref: ${{ (inputs.tag != '' && !inputs.dry_run ) && format('refs/tags/v{0}', inputs.tag) || github.ref }}
58+
ref: ${{ (inputs.tag != '' && !inputs.dry_run && inputs.image != 'operator') && format('refs/tags/{0}', inputs.tag) || github.ref }}
5959

6060
- name: Download Artifacts
6161
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
@@ -73,6 +73,13 @@ jobs:
7373
with:
7474
platforms: arm64
7575

76+
- name: Login to Docker Hub
77+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
78+
with:
79+
username: ${{ secrets.DOCKER_USERNAME }}
80+
password: ${{ secrets.DOCKER_PASSWORD }}
81+
if: ${{ inputs.runner == 'ubuntu-24.04-amd64' }}
82+
7683
- name: Login to GitHub Container Registry
7784
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
7885
if: ${{ github.event_name != 'pull_request' && ! contains(inputs.image, 'plus') }}
@@ -128,14 +135,13 @@ jobs:
128135
name=ghcr.io/${{ github.repository_owner }}/nginx-gateway-fabric/operator,enable=${{ inputs.image == 'operator' && github.event_name != 'pull_request' }}
129136
name=localhost:5000/nginx-gateway-fabric/${{ inputs.image }}
130137
flavor: |
131-
latest=${{ (inputs.tag != '' && 'true') || 'auto' }}
138+
latest=${{ inputs.build-os != '' && 'false' || (inputs.tag != '' && 'true') || 'auto' }}
132139
tags: |
133-
type=semver,pattern={{version}},suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
140+
type=semver,pattern={{version}},value=${{ inputs.tag }},enable=${{ inputs.tag != '' }},suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
134141
type=edge,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
135142
type=schedule,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
136143
type=ref,event=pr,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
137144
type=ref,event=branch,suffix=-rc${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }},enable=${{ startsWith(github.ref, 'refs/heads/release') && inputs.tag == '' }}
138-
type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }},suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
139145
labels: |
140146
org.opencontainers.image.documentation=https://docs.nginx.com/nginx-gateway-fabric
141147
org.opencontainers.image.vendor=NGINX Inc <[email protected]>
@@ -184,15 +190,15 @@ jobs:
184190
- name: Scan SBOM
185191
id: scan
186192
if: ${{ !inputs.dry_run }}
187-
uses: anchore/scan-action@a5605eb0943e46279cb4fbd9d44297355d3520ab # v7.0.2
193+
uses: anchore/scan-action@568b89d27fc18c60e56937bff480c91c772cd993 # v7.1.0
188194
with:
189195
sbom: "sbom-${{ inputs.image }}.json"
190196
only-fixed: true
191197
add-cpes-if-none: true
192198
fail-build: false
193199

194200
- name: Upload scan result to GitHub Security tab
195-
uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v4.30.8
201+
uses: github/codeql-action/upload-sarif@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
196202
if: ${{ !inputs.dry_run }}
197203
continue-on-error: true
198204
with:

.github/workflows/ci.yml

Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,25 @@ on:
1010
- "**"
1111
schedule:
1212
- cron: "0 3 * * *" # run every day at 3am UTC (nightly builds)
13-
workflow_call:
13+
workflow_dispatch:
1414
inputs:
1515
is_production_release:
16+
description: 'Is this a production release?'
1617
required: false
1718
type: boolean
1819
default: false
1920
release_version:
21+
description: 'Release version (e.g., v2.0.3)'
2022
required: false
2123
type: string
2224
default: ''
2325
operator_version:
26+
description: 'Operator release version (e.g., v1.0.0). Optional'
2427
required: false
2528
type: string
2629
default: ''
2730
dry_run:
31+
description: 'If true, does a dry run of the production workflow'
2832
required: false
2933
type: boolean
3034
default: false
@@ -34,13 +38,70 @@ defaults:
3438
shell: bash
3539

3640
concurrency:
37-
group: ${{ github.ref_name }}-ci
38-
cancel-in-progress: true
41+
group: ${{ inputs.is_production_release && format('prod-{0}', inputs.release_version) || format('{0}-ci', github.ref_name) }}
42+
cancel-in-progress: ${{ !inputs.is_production_release }}
3943

4044
permissions:
4145
contents: read
4246

4347
jobs:
48+
create-tag-and-release:
49+
runs-on: ubuntu-24.04
50+
if: github.event_name == 'workflow_dispatch' && inputs.release_version != '' && startsWith(github.ref, 'refs/heads/release-')
51+
permissions:
52+
contents: write
53+
steps:
54+
- name: Validate Release Branch and Version
55+
run: |
56+
echo "Validating release from: ${GITHUB_REF}"
57+
58+
INPUT_VERSION="${{ inputs.release_version }}"
59+
INPUT_OPERATOR_VERSION="${{ inputs.operator_version }}"
60+
61+
# Validate version format
62+
if [[ ! "${INPUT_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
63+
echo "❌ Invalid version format: ${INPUT_VERSION}"
64+
echo "Expected format: v1.2.3"
65+
exit 1
66+
fi
67+
68+
# Validate version format if operator version is provided
69+
if [[ -n "${INPUT_OPERATOR_VERSION}" && ! "${INPUT_OPERATOR_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
70+
echo "❌ Invalid operator version format: ${INPUT_OPERATOR_VERSION}"
71+
echo "Expected format: v1.2.3"
72+
exit 1
73+
fi
74+
75+
echo "✅ Valid release branch: ${GITHUB_REF}"
76+
echo "✅ Valid version format: ${INPUT_VERSION}"
77+
[[ -n "${INPUT_OPERATOR_VERSION}" ]] && echo "✅ Valid operator version format: ${INPUT_OPERATOR_VERSION}"
78+
79+
- name: Checkout Repository
80+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
81+
with:
82+
fetch-depth: 0
83+
84+
- name: Create Release Tag
85+
run: |
86+
VERSION="${{ inputs.release_version }}"
87+
git config user.name "NGF Release Bot"
88+
git config user.email "[email protected]"
89+
90+
if git rev-parse --verify "refs/tags/${VERSION}" >/dev/null 2>&1; then
91+
echo "Tag ${VERSION} already exists - skipping tag creation"
92+
else
93+
echo "Creating annotated tag ${VERSION}"
94+
git tag -a "${VERSION}" -m "Release ${VERSION}"
95+
96+
if [[ "${{ inputs.dry_run }}" == "true" ]]; then
97+
echo "DRY RUN: Would push tag ${VERSION} and operator tag ${{ inputs.operator_version || '' }}"
98+
git push --dry-run origin "${VERSION}"
99+
else
100+
git push origin "${VERSION}"
101+
echo "Created and pushed tag: ${VERSION}"
102+
fi
103+
fi
104+
44105
vars:
45106
name: Checks and variables
46107
runs-on: ubuntu-24.04
@@ -224,7 +285,7 @@ jobs:
224285

225286
- name: Download Syft
226287
if: ${{ inputs.is_production_release }}
227-
uses: anchore/sbom-action/download-syft@aa0e114b2e19480f157109b9922bda359bd98b90 # v0.20.8
288+
uses: anchore/sbom-action/download-syft@8e94d75ddd33f69f691467e42275782e4bfefe84 # v0.20.9
228289

229290
- name: Install Cosign
230291
if: ${{ inputs.is_production_release }}
@@ -233,7 +294,7 @@ jobs:
233294
- name: Build binary
234295
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
235296
with:
236-
version: v2.12.5 # renovate: datasource=github-tags depName=goreleaser/goreleaser
297+
version: v2.12.6 # renovate: datasource=github-tags depName=goreleaser/goreleaser
237298
args: ${{ (inputs.is_production_release && (inputs.dry_run == false || inputs.dry_run == null)) && 'release' || 'build --snapshot' }} --clean
238299
env:
239300
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -485,21 +546,25 @@ jobs:
485546
with:
486547
image: ${{ matrix.image }}
487548
k8s-version: ${{ matrix.k8s-version }}
549+
tag: ${{ inputs.release_version || '' }}
488550
secrets: inherit
489551
if: ${{ needs.vars.outputs.helm_changes == 'true' || github.event_name == 'schedule' }}
490552

491553
publish-helm:
492554
name: Package and Publish Helm Chart
493-
runs-on: ${{ github.repository_owner == 'nginx' && (inputs.is_production_release || ((github.event_name == 'push' || github.event_name == 'schedule') && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-')))) && 'ubuntu-24.04-amd64' || 'ubuntu-24.04' }}
555+
runs-on: ${{ github.repository_owner == 'nginx' && 'ubuntu-24.04-amd64' || 'ubuntu-24.04' }}
494556
needs: [vars, helm-tests]
495-
if: ${{ (inputs.is_production_release && (inputs.dry_run == false || inputs.dry_run == null)) || (github.event_name == 'push' && ! startsWith(github.ref, 'refs/heads/release-')) }}
557+
if: ${{ inputs.is_production_release || github.ref == 'refs/heads/main' }}
496558
permissions:
497559
contents: read
498560
packages: write # for helm to push to GHCR
499561
steps:
500562
- name: Checkout Repository
501563
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
502564

565+
- name: Setup Helm
566+
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
567+
503568
- name: Login to GitHub Container Registry
504569
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
505570
with:

.github/workflows/conformance.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
type=schedule,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
8989
type=ref,event=pr,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
9090
type=ref,event=branch,suffix=-rc${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }},enable=${{ startsWith(github.ref, 'refs/heads/release') && !inputs.production-release }}
91-
type=raw,value={{ inputs.release_version }},enable=${{ inputs.production-release && inputs.release_version != '' }},suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
91+
type=raw,value=${{ inputs.release_version }},enable=${{ inputs.production-release && inputs.release_version != '' }},suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
9292
9393
- name: NGINX Docker meta
9494
id: nginx-meta
@@ -102,12 +102,12 @@ jobs:
102102
type=schedule,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
103103
type=ref,event=pr,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
104104
type=ref,event=branch,suffix=-rc${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }},enable=${{ startsWith(github.ref, 'refs/heads/release') && !inputs.production-release }}
105-
type=raw,value={{ inputs.release_version }},enable=${{ inputs.production-release && inputs.release_version != '' }},suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
105+
type=raw,value=${{ inputs.release_version }},enable=${{ inputs.production-release && inputs.release_version != '' }},suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
106106
107107
- name: Build binary
108108
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
109109
with:
110-
version: v2.12.5 # renovate: datasource=github-tags depName=goreleaser/goreleaser
110+
version: v2.12.6 # renovate: datasource=github-tags depName=goreleaser/goreleaser
111111
args: build --single-target --snapshot --clean
112112
env:
113113
TELEMETRY_ENDPOINT: "" # disables sending telemetry

.github/workflows/functional.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
- name: Build binary
8888
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
8989
with:
90-
version: v2.12.5 # renovate: datasource=github-tags depName=goreleaser/goreleaser
90+
version: v2.12.6 # renovate: datasource=github-tags depName=goreleaser/goreleaser
9191
args: build --single-target --snapshot --clean
9292
env:
9393
TELEMETRY_ENDPOINT: otel-collector-opentelemetry-collector.collector.svc.cluster.local:4317

.github/workflows/helm.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
k8s-version:
1010
required: true
1111
type: string
12+
tag:
13+
required: false
14+
type: string
15+
default: ''
1216

1317
permissions:
1418
contents: read
@@ -40,10 +44,11 @@ jobs:
4044
images: |
4145
name=ghcr.io/nginx/nginx-gateway-fabric
4246
tags: |
43-
type=semver,pattern={{version}}
47+
type=semver,pattern={{version}},value=${{ inputs.tag }},enable=${{ inputs.tag != '' }}
4448
type=edge
4549
type=schedule
4650
type=ref,event=pr
51+
type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') && inputs.tag == '' }}
4752
4853
- name: NGINX Docker meta
4954
id: nginx-meta
@@ -52,10 +57,11 @@ jobs:
5257
images: |
5358
name=ghcr.io/nginx/nginx-gateway-fabric/${{ inputs.image == 'plus' && 'nginx-plus' || inputs.image }}
5459
tags: |
55-
type=semver,pattern={{version}}
60+
type=semver,pattern={{version}},value=${{ inputs.tag }},enable=${{ inputs.tag != '' }}
5661
type=edge
5762
type=schedule
5863
type=ref,event=pr
64+
type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') && inputs.tag == '' }}
5965
6066
- name: Build NGF Docker Image
6167
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0

.github/workflows/nfr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ jobs:
149149
run: make create-gke-router || true
150150

151151
- name: Run Tests
152+
continue-on-error: true
152153
working-directory: ./tests
153154
run: |
154155
if ${{ needs.vars.outputs.test_label != 'all' }}; then

.github/workflows/production-release.yml

Lines changed: 0 additions & 101 deletions
This file was deleted.

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ jobs:
6060

6161
# Upload the results to GitHub's code scanning dashboard.
6262
- name: "Upload to code-scanning"
63-
uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v4.30.8
63+
uses: github/codeql-action/upload-sarif@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
6464
with:
6565
sarif_file: results.sarif

0 commit comments

Comments
 (0)