Skip to content

Commit 00890a5

Browse files
authored
feat(ci): release workflow updates the latest branch to point to latest tag (#4305) (#4356)
1 parent 87f03e6 commit 00890a5

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.github/ISSUE_TEMPLATE/release.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ body:
6262
- label: If this is a patch release, ensure that the release branch (e.g. `release/2.9.x`) compared against the latest patch for this minor release (e.g. `v2.9.0`) includes the expected changes that the release should include (e.g. by checking [https://github.com/kong/kubernetes-ingress-controller/compare/v2.9.0..release/2.9.x](https://github.com/kong/kubernetes-ingress-controller/compare/v2.9.0..release/2.9.x)).
6363
- label: Once the PR is merged (the `prepare-release/x.y.z` branch will get automatically removed), approve and merge the automatic backport PR and [initiate a release job](https://github.com/Kong/kubernetes-ingress-controller/actions/workflows/release.yaml) on the release branch. Your tag must use `vX.Y.Z` format. Set `latest` to true if this will be the latest release.
6464
- label: CI will validate the requested version, build and push an image, and run tests against the image before finally creating a tag and publishing a release. If tests fail, CI will push the image but not the tag or release. Investigate the failure, correct it as needed, and start a new release job.
65+
- label: The release workflow ([.github/workflows/release.yaml](/Kong/kubernetes-ingress-controller/blob/main/.github/workflows/release.yaml)) will update the `latest` branch - if the released version was set to be `latest` - to the just released tag.
6566
- type: checkboxes
6667
id: release_documents
6768
attributes:
@@ -76,7 +77,7 @@ body:
7677
- label: Add a section to `app/_data/kong_versions.yml` for your version.
7778
- label: "Add entries in support policy documents: `app/_includes/md/support-policy.md` and `app/_src/kubernetes-ingress-controller/support-policy.md`."
7879
- label: Mark the PR ready for review.
79-
- label: Inform and ping the @team-k8s via slack of impending release with a link to the release PR.
80+
- label: Inform and ping the @Kong/team-k8s via slack of impending release with a link to the release PR.
8081
- type: textarea
8182
id: release_trouble_shooting_link
8283
attributes:

.github/workflows/release.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,19 @@ jobs:
197197
# When prerelease part of the input tag is not empty, make it a prerelease.
198198
# The release will be labeled as non-production ready in GitHub.
199199
prerelease: ${{ steps.semver_parser.outputs.prerelease != '' }}
200+
201+
update-latest-branch:
202+
runs-on: ubuntu-latest
203+
if: github.event.inputs.latest == 'true'
204+
needs:
205+
- publish-release
206+
steps:
207+
- name: checkout repository
208+
uses: actions/checkout@v3
209+
with:
210+
fetch-depth: 0
211+
- name: update 'latest' branch
212+
run: |
213+
git checkout latest
214+
git reset --hard v${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }}.${{ steps.semver_parser.outputs.patch }}
215+
git push latest

0 commit comments

Comments
 (0)