Skip to content

Commit d96e0c2

Browse files
authored
add release workflow (nginx#5742)
1 parent d73de4f commit d96e0c2

File tree

6 files changed

+519
-18
lines changed

6 files changed

+519
-18
lines changed

.github/workflows/build-oss.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ jobs:
221221
architecture=("${arch#*/}")
222222
./preflight check container quay.io/nginx/nginx-ingress:${{ steps.meta.outputs.version }} --pyxis-api-token ${{ secrets.PYXIS_API_TOKEN }} --certification-project-id ${{ secrets.CERTIFICATION_PROJECT_ID }} --platform $architecture --submit
223223
done
224-
if: ${{ github.ref_type == 'tag' && contains(inputs.image, 'ubi') }}
224+
if: ${{ (github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true') && contains(inputs.image, 'ubi') }}
225225

226226
- name: Run Trivy vulnerability scanner
227227
uses: aquasecurity/trivy-action@595be6a0f6560a0a8fc419ddf630567fc623531d # 0.22.0

.github/workflows/build-plus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ jobs:
174174
push: true
175175
build-args: |
176176
BUILD_OS=${{ inputs.image }}
177-
IC_VERSION=${{ github.ref_type == 'tag' && steps.meta.outputs.version || 'CI' }}
177+
IC_VERSION=${{ (github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true') && steps.meta.outputs.version || 'CI' }}
178178
${{ steps.nap_modules.outputs.modules != '' && format('NAP_MODULES={0}', steps.nap_modules.outputs.modules) || '' }}
179179
secrets: |
180180
"nginx-repo.crt=${{ inputs.nap_modules != '' && secrets.NGINX_AP_CRT || secrets.NGINX_CRT }}"
@@ -203,7 +203,7 @@ jobs:
203203
build-args: |
204204
BUILD_OS=${{ inputs.image }}
205205
PREBUILT_BASE_IMG=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/plus:${{ inputs.base-image-md5 }}-${{ inputs.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }}
206-
IC_VERSION=${{ github.ref_type == 'tag' && steps.meta.outputs.version || 'CI' }}
206+
IC_VERSION=${{ (github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true') && steps.meta.outputs.version || 'CI' }}
207207
${{ inputs.nap_modules != '' && format('NAP_MODULES={0}', steps.nap_modules.outputs.modules) || '' }}
208208
${{ contains(inputs.image, 'v5') && 'WAF_VERSION=v5' || '' }}
209209
${{ (contains(inputs.target, 'aws') && inputs.nap_modules != '') && format('NAP_MODULES_AWS={0}', steps.nap_modules.outputs.modules) || '' }}

.github/workflows/cache-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
with:
5656
minor-label: "enhancement"
5757
major-label: "change"
58-
publish: ${{ github.ref_type == 'tag' }}
58+
publish: false
5959
collapse-after: 50
6060
variables: |
6161
helm-chart=${{ needs.checks.outputs.chart_version }}

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
publish=false
108108
if ${{ github.event_name == 'workflow_dispatch' && inputs.publish-image }}; then
109109
publish=true
110-
elif ${{ github.ref_type == 'tag' && startsWith(github.ref, 'refs/heads/release-') }}; then
110+
elif ${{ (github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true') && startsWith(github.ref, 'refs/heads/release-') }}; then
111111
publish=true
112112
elif ${{ github.event_name != 'workflow_dispatch' && github.event_name != 'pull_request' && ! startsWith(github.ref, 'refs/heads/release-') }}; then
113113
publish=true
@@ -181,7 +181,7 @@ jobs:
181181
with:
182182
minor-label: "enhancement"
183183
major-label: "change"
184-
publish: ${{ github.ref_type == 'tag' }}
184+
publish: ${{ github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true' }}
185185
collapse-after: 50
186186
variables: |
187187
helm-chart=${{ needs.checks.outputs.chart_version }}
@@ -220,17 +220,17 @@ jobs:
220220

221221
- name: Download Syft
222222
uses: anchore/sbom-action/download-syft@e8d2a6937ecead383dfe75190d104edd1f9c5751 # v0.16.0
223-
if: github.ref_type == 'tag'
223+
if: ${{ github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true' }}
224224

225225
- name: Install Cosign
226226
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0
227-
if: github.ref_type == 'tag'
227+
if: ${{ github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true' }}
228228

229229
- name: Build binaries
230230
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
231231
with:
232232
version: latest
233-
args: ${{ github.ref_type == 'tag' && 'release' || 'build --snapshot' }} ${{ github.event_name == 'pull_request' && '--single-target' || '' }} --clean
233+
args: ${{ (github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true') && 'release' || 'build --snapshot' }} ${{ github.event_name == 'pull_request' && '--single-target' || '' }} --clean
234234
env:
235235
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
236236
GOPATH: ${{ needs.checks.outputs.go_path }}
@@ -690,7 +690,7 @@ jobs:
690690
base-image-md5: ${{ needs.checks.outputs.docker_md5 }}
691691
release-url: ${{ needs.release-notes.outputs.release-url }}
692692
publish-image: ${{ needs.checks.outputs.publish_images == 'true' }}
693-
publish-aws-market-place: ${{ github.ref_type == 'tag' && startsWith(github.ref, 'refs/heads/release-') && contains(matrix.target, 'aws') }}
693+
publish-aws-market-place: ${{ (github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true') && startsWith(github.ref, 'refs/heads/release-') && contains(matrix.target, 'aws') }}
694694
publish-nginx-reqistry: ${{ needs.checks.outputs.publish_images == 'true' && ! contains(matrix.target, 'aws') }}
695695
forked-workflow: ${{ needs.checks.outputs.forked_workflow == 'true' }}
696696
permissions:
@@ -765,7 +765,7 @@ jobs:
765765
nap_modules: ${{ matrix.nap_modules }}
766766
release-url: ${{ needs.release-notes.outputs.release-url }}
767767
publish-image: ${{ needs.checks.outputs.publish_images == 'true' }}
768-
publish-aws-market-place: ${{ github.ref_type == 'tag' && startsWith(github.ref, 'refs/heads/release-') && contains(matrix.target, 'aws') }}
768+
publish-aws-market-place: ${{ (github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true') && startsWith(github.ref, 'refs/heads/release-') && contains(matrix.target, 'aws') }}
769769
publish-nginx-reqistry: ${{ needs.checks.outputs.publish_images == 'true' && ! contains(matrix.target, 'aws') }}
770770
forked-workflow: ${{ needs.checks.outputs.forked_workflow == 'true' }}
771771
permissions:
@@ -784,9 +784,9 @@ jobs:
784784
uses: ./.github/workflows/publish-helm.yml
785785
with:
786786
branch: ${{ github.ref_name }}
787-
ic_version: ${{ github.ref_type == 'tag' && needs.checks.outputs.ic_version || 'edge' }}
788-
chart_version: ${{ github.ref_type == 'tag' && needs.checks.outputs.chart_version || '0.0.0-edge' }}
789-
nginx_helm_repo: ${{ github.ref_type == 'tag' }}
787+
ic_version: ${{ (github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true') && needs.checks.outputs.ic_version || 'edge' }}
788+
chart_version: ${{ (github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true') && needs.checks.outputs.chart_version || '0.0.0-edge' }}
789+
nginx_helm_repo: ${{ github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true' }}
790790
secrets: inherit
791791

792792
operator:
@@ -808,7 +808,7 @@ jobs:
808808
chart_version: '${{ needs.checks.outputs.chart_version }}'
809809
},
810810
})
811-
if: github.ref_type == 'tag'
811+
if: ${{ github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true' }}
812812

813813
gcp-marketplace:
814814
name: Trigger PR for GCP Marketplace
@@ -829,4 +829,4 @@ jobs:
829829
chart_version: '${{ needs.checks.outputs.chart_version }}'
830830
},
831831
})
832-
if: github.ref_type == 'tag'
832+
if: ${{ github.ref_type == 'tag' && vars.OLD_RELEASE_FLOW == 'true' }}

0 commit comments

Comments
 (0)