diff --git a/.github/workflows/build-plus.yml b/.github/workflows/build-plus.yml index fcd7926fe2..9340b2898c 100644 --- a/.github/workflows/build-plus.yml +++ b/.github/workflows/build-plus.yml @@ -76,13 +76,13 @@ jobs: with: aws-region: us-east-1 role-to-assume: ${{ secrets.AWS_ROLE_MARKETPLACE }} - if: startsWith(github.ref, 'refs/tags/') && contains(inputs.target, 'aws') + if: github.ref_type == 'tag' && contains(inputs.target, 'aws') - name: Login to ECR uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 with: registry: 709825985650.dkr.ecr.us-east-1.amazonaws.com - if: startsWith(github.ref, 'refs/tags/') && contains(inputs.target, 'aws') + if: github.ref_type == 'tag' && contains(inputs.target, 'aws') - name: Docker meta id: meta @@ -90,8 +90,8 @@ jobs: with: images: | name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}/nginx-plus-ingress - name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}/nginx-plus-ingress,enable=${{ startsWith(github.ref, 'refs/tags/') }} - name=709825985650.dkr.ecr.us-east-1.amazonaws.com/nginx/nginx-plus-ingress${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }},enable=${{ startsWith(github.ref, 'refs/tags/') && contains(inputs.target, 'aws') }} + name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}/nginx-plus-ingress,enable=${{ github.ref_type == 'tag' }} + name=709825985650.dkr.ecr.us-east-1.amazonaws.com/nginx/nginx-plus-ingress${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }},enable=${{ github.ref_type == 'tag' && contains(inputs.target, 'aws') }} flavor: | suffix=${{ contains(inputs.image, 'ubi') && '-ubi' || '' }}${{ contains(inputs.image, 'alpine') && '-alpine' || '' }}${{ contains(inputs.target, 'aws') && '-mktpl' || '' }}${{ contains(inputs.image, 'fips') && '-fips' || ''}},onlatest=true latest=${{ contains(inputs.target, 'aws') && 'false' || 'auto' }} @@ -132,7 +132,7 @@ jobs: provenance: false build-args: | BUILD_OS=${{ inputs.image }} - IC_VERSION=${{ startsWith(github.ref, 'refs/tags/') && steps.meta.outputs.version || 'CI' }} + IC_VERSION=${{ github.ref_type == 'tag' && steps.meta.outputs.version || 'CI' }} ${{ inputs.nap_modules != '' && format('NAP_MODULES={0}', inputs.nap_modules) || '' }} ${{ steps.nap_modules.outputs.modules != '' && format('NAP_MODULES_AWS={0}', steps.nap_modules.outputs.modules) || '' }} secrets: | @@ -156,7 +156,7 @@ jobs: echo "version=$version" >> $GITHUB_OUTPUT echo "product_code=AWS${nap}_PRODUCT_ID" >> $GITHUB_OUTPUT echo "registry=${aws_registry}" >> $GITHUB_OUTPUT - if: startsWith(github.ref, 'refs/tags/') && contains(inputs.target, 'aws') + if: github.ref_type == 'tag' && contains(inputs.target, 'aws') - name: Publish to AWS Marketplace uses: nginxinc/aws-marketplace-publish@93e03c5ce4baa842a8e5baad0a3f35d07b38460c # v0.1.2 @@ -173,7 +173,7 @@ jobs: This container requires Kubernetes and can be deployed to EKS. Review the installation instructions https://docs.nginx.com/nginx-ingress-controller/installation/ and utilize the deployment resources available https://github.com/nginxinc/kubernetes-ingress/tree/master/deployments Use this image instead of building your own. - if: ${{ startsWith(github.ref, 'refs/tags/') && contains(inputs.target, 'aws') }} + if: ${{ github.ref_type == 'tag' && contains(inputs.target, 'aws') }} - name: Load image for Trivy uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1 @@ -186,7 +186,7 @@ jobs: load: true build-args: | BUILD_OS=${{ inputs.image }} - IC_VERSION=${{ startsWith(github.ref, 'refs/tags/') && steps.meta.outputs.version || 'CI' }} + IC_VERSION=${{ github.ref_type == 'tag' && steps.meta.outputs.version || 'CI' }} ${{ inputs.nap_modules != '' && format('NAP_MODULES={0}', inputs.nap_modules) || '' }} ${{ steps.nap_modules.outputs.modules != '' && format('NAP_MODULES_AWS={0}', steps.nap_modules.outputs.modules) || '' }} secrets: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3ab9e7491..8ec67c7047 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: with: minor-label: "enhancement" major-label: "change" - publish: ${{ startsWith(github.ref, 'refs/tags/') }} + publish: ${{ github.ref_type == 'tag' }} collapse-after: 50 variables: | helm-chart=${{ needs.checks.outputs.chart_version }} @@ -134,7 +134,7 @@ jobs: uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0 with: version: latest - args: ${{ startsWith(github.ref, 'refs/tags/') && 'release' || 'build --snapshot' }} ${{ github.event_name == 'pull_request' && '--single-target' || '' }} --clean + args: ${{ github.ref_type == 'tag' && 'release' || 'build --snapshot' }} ${{ github.event_name == 'pull_request' && '--single-target' || '' }} --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GOPATH: ${{ needs.checks.outputs.go_path }} @@ -418,7 +418,7 @@ jobs: - name: Package id: package run: | - output=$(helm package ${{ ! startsWith(github.ref, 'refs/tags/') && '--app-version edge --version 0.0.0-edge' || '' }} kic/deployments/helm-chart) + output=$(helm package ${{ github.ref_type != 'tag' && '--app-version edge --version 0.0.0-edge' || '' }} kic/deployments/helm-chart) echo "path=$(basename -- $(echo $output | cut -d: -f2))" >> $GITHUB_OUTPUT - name: Push to OCI registries @@ -433,7 +433,7 @@ jobs: fetch-depth: 1 token: ${{ secrets.NGINX_PAT }} path: helm-charts - if: ${{ startsWith(github.ref, 'refs/tags/') }} + if: github.ref_type == 'tag' - name: Push Helm Chart to Helm Charts Repository run: | @@ -444,4 +444,4 @@ jobs: git -c user.name='NGINX Kubernetes Team' -c user.email='kubernetes@nginx.com' \ commit -m "NGINX Ingress Controller - Release ${{ needs.checks.outputs.chart_version }}" git push -u origin master - if: ${{ startsWith(github.ref, 'refs/tags/') }} + if: github.ref_type == 'tag' diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 924b984d1b..21249a07f9 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -15,3 +15,4 @@ jobs: - uses: actions/labeler@4f052778de9a9b80cb16cfb9079b02287285a4cb # v5.0.0-alpha.1 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" + sync-labels: true diff --git a/.github/workflows/update-docker-images.yml b/.github/workflows/update-docker-images.yml index fa530b167b..3e0528bd92 100644 --- a/.github/workflows/update-docker-images.yml +++ b/.github/workflows/update-docker-images.yml @@ -52,7 +52,8 @@ jobs: - name: Set other variables id: vars run: | - echo "k8s_version=$(grep -m1 'FROM kindest/node' > $GITHUB_OUTPUT + # TODO fix test folder after v3.3.0 + echo "k8s_version=$(grep -m1 'FROM kindest/node' > $GITHUB_OUTPUT check: name: Check if updates are needed @@ -109,7 +110,7 @@ jobs: uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0 with: version: latest - args: build --rm-dist --id kubernetes-ingress + args: build --clean --id kubernetes-ingress env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GOPATH: ${{ steps.go.outputs.go_path }}