Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Release PR workflow #1732

Merged
merged 7 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/CHANGELOG_TEMPLATE.md
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%%`
3 changes: 1 addition & 2 deletions .github/workflows/nfr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)' || ''}}
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
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: |
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: 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.
Loading