-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: Manually updating the old tag is boring and error prone Solution: Automate the process and automatically open a PR for the release
- Loading branch information
1 parent
8ac5ff5
commit e979c0a
Showing
4 changed files
with
138 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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%%` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <[email protected]> | ||
committer: nginx-bot <[email protected]> | ||
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)' || ''}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' <deploy/helm-chart/Chart.yaml)" >> $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 <[email protected]> | ||
committer: nginx-bot <[email protected]> | ||
body: | | ||
This automated PR updates all the necessary files for ${{ inputs.version }} release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters