diff --git a/.github/CHANGELOG_TEMPLATE.md b/.github/CHANGELOG_TEMPLATE.md new file mode 100644 index 0000000000..1c6c08c8cd --- /dev/null +++ b/.github/CHANGELOG_TEMPLATE.md @@ -0,0 +1,36 @@ +## Release %%VERSION%% + +%%DATE%% + +FEATURES: + +- + +BUG FIXES: + +- + +DOCUMENTATION: + +- + +HELM CHART: + +- The version of the Helm chart is now %%VERSION%% +- + +UPGRADE: + +- + +COMPATIBILITY: + +- The Gateway API version: `` +- NGINX version: `` +- Kubernetes version: `` + +CONTAINER IMAGES: + +- Control plane: `ghcr.io/nginxinc/nginx-gateway-fabric:%%VERSION%%` +- Data plane: `ghcr.io/nginxinc/nginx-gateway-fabric/nginx:%%VERSION%%` +- Data plane with NGINX Plus: `private-registry.nginx.com/nginx-gateway-fabric/nginx-plus:%%VERSION%%` diff --git a/.github/workflows/nfr.yml b/.github/workflows/nfr.yml index 31f661c4df..76220e9bff 100644 --- a/.github/workflows/nfr.yml +++ b/.github/workflows/nfr.yml @@ -46,8 +46,6 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - with: - token: ${{ secrets.NGINX_PAT }} - name: Setup Golang Environment uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 @@ -165,6 +163,7 @@ jobs: token: ${{ secrets.NGINX_PAT }} commit-message: NFR Test Results for NGF version ${{ inputs.version }} ${{ inputs.nginx_plus == true && '(Plus)' || ''}} author: nginx-bot + committer: nginx-bot branch: tests/nfr-tests-${{ inputs.version }}${{ inputs.nginx_plus == true && '-plus' || ''}} delete-branch: true title: NFR Test Results for NGF version ${{ inputs.version }} ${{ inputs.nginx_plus == true && '(Plus)' || ''}} diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml new file mode 100644 index 0000000000..498b8cd383 --- /dev/null +++ b/.github/workflows/release-pr.yml @@ -0,0 +1,81 @@ +name: Release PR + +on: + workflow_dispatch: + inputs: + version: + description: "Version to release" + required: true + default: "0.0.0" + +defaults: + run: + shell: bash + +jobs: + release: + runs-on: ubuntu-22.04 + steps: + - name: Branch + id: branch + run: | + version=${{ github.event.inputs.version }} + version=${version%.*} + echo "branch=release-$version" >> $GITHUB_OUTPUT + + - name: Checkout Repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: ${{ steps.branch.outputs.branch }} + + - name: Vars + id: vars + run: | + # TODO(lucacome): improve this and maybe use appVersion instead of version if we switch to tags + echo "current_version=$(yq '.version' > $GITHUB_OUTPUT + + - name: Find and Replace + uses: jacobtomlinson/gha-find-replace@a51bbcd94d000df9ca0fcb54ec8be69aad8374b0 # v3.0.2 + with: + find: ${{ steps.vars.outputs.current_version }} + replace: ${{ inputs.version }} + include: "site/content/**/*.md" + regex: false + + - name: Find and Replace + uses: jacobtomlinson/gha-find-replace@a51bbcd94d000df9ca0fcb54ec8be69aad8374b0 # v3.0.2 + with: + find: "edge" + replace: ${{ inputs.version }} + include: "deploy/helm-chart/*.yaml" + regex: false + + - name: Find and Replace + uses: jacobtomlinson/gha-find-replace@a51bbcd94d000df9ca0fcb54ec8be69aad8374b0 # v3.0.2 + with: + find: "Always" + replace: "IfNotPresent" + include: "deploy/helm-chart/*.yaml" + regex: false + + - name: Generate manifests and changelog + run: | + sed -i -e "s/v${{ steps.vars.outputs.current_version }}/v${{ inputs.version }}/g" README.md + sed -i -e "s/VERSION = edge/VERSION = ${{ inputs.version }}/g" Makefile + sed -i -e "s/VERSION = ${{ steps.vars.outputs.current_version }}/VERSION = ${{ inputs.version }}/g" conformance/Makefile + sed -i -e "s/TAG = edge/TAG = ${{ inputs.version }}/g" **/Makefile + sed -i "5r .github/CHANGELOG_TEMPLATE.md" CHANGELOG.md + sed -i -e "s/%%VERSION%%/${{ inputs.version }}/g" CHANGELOG.md + make generate-manifests + + - name: Create Pull Request + uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 + with: + token: ${{ secrets.NGINX_PAT }} + commit-message: Release ${{ inputs.version }} + title: Release ${{ inputs.version }} + branch: docs/release-${{ inputs.version }} + author: nginx-bot + committer: nginx-bot + body: | + This automated PR updates all the necessary files for ${{ inputs.version }} release. diff --git a/docs/developer/release-process.md b/docs/developer/release-process.md index 16a969e008..64d4e5e1ab 100644 --- a/docs/developer/release-process.md +++ b/docs/developer/release-process.md @@ -30,36 +30,27 @@ To create a new release, follow these steps: 3. Test the main branch for release-readiness. For that, use the `edge` containers, which are built from the main branch, and run the following: 1. Run the [example applications](/examples) manually and verify their correctness. - 2. Kick off the [NFR workflow](https://github.com/nginxinc/nginx-gateway-fabric/actions/nfr.yml) in the browser. For `image_tag`, use `edge`, and for `version`, use the upcoming `X.Y.Z` NGF version. This will run all of the NFR tests which are automated and open a PR with the results files when it is complete. Review this PR and make any necessary changes before merging. + 2. Kick off the [NFR workflow](https://github.com/nginxinc/nginx-gateway-fabric/actions/nfr.yml) in the browser. For `image_tag`, use `edge`, and for `version`, use the upcoming `X.Y.Z` NGF version. This will run all of the NFR tests which are automated and open a PR with the results files when it is complete. Review this PR and make any necessary changes before merging. 4. If a problem is found, prepare a fix PR, merge it into the main branch and return to the previous step. 5. If the supported Gateway API minor version has changed since the last release, test NGINX Gateway Fabric with the previous version of the Gateway API CRDs. 6. If a compatibility issue is found, add a note to the release notes explaining that the previous version is not supported. 7. Create a release branch following the `release-X.Y` naming convention. -8. Prepare and merge a PR into the **release branch** to update the repo files for the release: - 1. Update the Helm [Chart.yaml](/deploy/helm-chart/Chart.yaml): the `appVersion` to `X.Y.Z`, the icon and source - URLs to point at `vX.Y.Z`, and bump the `version`. - 2. Adjust the `VERSION` variable in the [Makefile](/Makefile) and the `TAG` in the - [conformance tests Makefile](/conformance/Makefile) to `X.Y.Z`. - 3. Update the tag of NGF container images used in the Helm [values.yaml](/deploy/helm-chart/values.yaml) file, - the [provisioner manifest](/conformance/provisioner/provisioner.yaml), and all docs to `X.Y.Z`. - 4. Ensure that the `imagePullPolicy` is `IfNotPresent` in the Helm [values.yaml](/deploy/helm-chart/values.yaml) - file. - 5. Generate the installation manifests by running `make generate-manifests`. - 6. Modify any `git clone` instructions to use `vX.Y.Z` tag. - 7. Modify any docs links that refer to `main` to instead refer to `vX.Y.Z` or `release-x-y`, whichever is applicable. - 8. Update any installation instructions to ensure that the supported Gateway API and NGF versions are correct. - Specifically, helm README and `site/content/includes/installation/install-gateway-api-resources.md`. - 9. Update the [README](/README.md) to include information about the release. - 10. Update the [changelog](/CHANGELOG.md). The changelog includes only important (from the user perspective) - changes to NGF. This is in contrast with the autogenerated full changelog, which is created in the next - step. As a starting point, copy the important features, bug fixes, and dependencies from the autogenerated - draft of the full changelog. This draft can be found under - the [GitHub releases](https://github.com/nginxinc/nginx-gateway-fabric/releases) after the release branch is - created. Use the previous changelog entries for formatting and content guidance. +8. Run the [Release PR](./../../.github/workflows/release-pr.yml) workflow to update the repo files for the release. Then there are a few manual steps to complete: + 1. Update the tag of NGF container images used in the [provisioner manifest](/conformance/provisioner/provisioner.yaml). + 2. Update any installation instructions to ensure that the supported Gateway API is correct. + Specifically, helm README and `site/content/includes/installation/install-gateway-api-resources.md`. + 3. Update the [README](/README.md) to include information about the release. + 4. Update the [changelog](/CHANGELOG.md). There is going to be a new blank section generated by the automation that needs to be adjusted accordingly. + The changelog includes only important (from the user perspective) + changes to NGF. This is in contrast with the autogenerated full changelog, which is created in the next + step. As a starting point, copy the important features, bug fixes, and dependencies from the autogenerated + draft of the full changelog. This draft can be found under + the [GitHub releases](https://github.com/nginxinc/nginx-gateway-fabric/releases) after the release branch is + created. 9. Create and push the release tag in the format `vX.Y.Z`. As a result, the CI/CD pipeline will: - - Build NGF, NGINX and NGINX Plus container images with the release tag `X.Y.Z` and push them to the registries. - - Package and publish the Helm chart to the registry. - - Create a GitHub release with an autogenerated changelog and attached release artifacts. + - Build NGF, NGINX and NGINX Plus container images with the release tag `X.Y.Z` and push them to the registries. + - Package and publish the Helm chart to the registry. + - Create a GitHub release with an autogenerated changelog and attached release artifacts. 10. Prepare and merge a PR into the main branch to update the [README](/README.md) to include the information about the latest release and also the [changelog](/CHANGELOG.md). Also update any installation instructions to ensure that the supported Gateway API and NGF versions are correct. Specifically, helm README and `site/content/includes/installation/install-gateway-api-resources.md`. @@ -70,9 +61,9 @@ To create a new release, follow these steps: 15. Submit the `conformance-profile.yaml` artifact from the release to the [Gateway API repo](https://github.com/kubernetes-sigs/gateway-api/tree/main/conformance/reports). - Create a fork of the repository - Name the file `nginxinc-nginx-gateway-fabric.yaml` and set `gatewayAPIVersion` in the file to the - supported version by NGF. Also update the site source if necessary (see following example). + supported version by NGF. Also update the site source if necessary (see following example). - Open a PR. [Example](https://github.com/kubernetes-sigs/gateway-api/pull/2514) - If it's your first time submitting a PR, you will need to sign a CLA using F5, Inc. as the organization. + If it's your first time submitting a PR, you will need to sign a CLA using F5, Inc. as the organization. ### Patch Release @@ -83,8 +74,8 @@ To create a new release, follow these steps: 1. Create an issue to define and track release-related activities. Choose a title that follows the format `Release X.Y.Z`. 2. If the fix applies to both the latest release and the main branch, then: - 1. Prepare and merge a fix PR into the in the main branch. - 2. Prepare and merge a fix PR (with a cherry-pick commit) into the existing release branch. + 1. Prepare and merge a fix PR into the in the main branch. + 2. Prepare and merge a fix PR (with a cherry-pick commit) into the existing release branch. 3. Alternatively, if the fix only applies to the latest release, prepare and merge a fix PR into the existing release branch. 4. Test the release branch for release-readiness.