-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add branch preparation and release CI changes (#567)
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
- Loading branch information
1 parent
005ddb3
commit 1e882fe
Showing
4 changed files
with
601 additions
and
55 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,131 @@ | ||
name: Branch Preparation | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'release/**' | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+**' | ||
|
||
jobs: | ||
update_release_branch_after_release: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.ref_type == 'tag' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: cachix/install-nix-action@v22 | ||
- name: Pre-populate nix-shell | ||
run: | | ||
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r) | ||
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV | ||
nix-shell --pure --run "echo" ./shell.nix | ||
- name: Test the chart version updater script | ||
run: | | ||
nix-shell --pure --run "./scripts/test-update-chart-version.sh" ./shell.nix | ||
- name: Modify the chart version based on the tag | ||
run: | | ||
tag=${{ github.ref_name }} | ||
echo "BASE=$(nix-shell --pure --run "./scripts/update-chart-version.sh --tag $tag" ./shell.nix)" >> $GITHUB_ENV | ||
- name: Create Pull Request to release | ||
if: ${{ env.BASE }} | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
base: ${{ env.BASE }} | ||
commit-message: "chore(ci): update helm chart versions and/or git submodules" | ||
committer: GitHub <noreply@github.com> | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
title: "Prepare release branch after release ${{ github.ref_name }}" | ||
labels: | | ||
update-release-branch | ||
automated-pr | ||
draft: false | ||
signoff: true | ||
branch: "create-pull-request/patch-${{ env.BASE }}" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
update_develop_branch_on_release_branch_creation: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.ref_type == 'branch' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- run: | | ||
git checkout develop | ||
- uses: cachix/install-nix-action@v22 | ||
- name: Pre-populate nix-shell | ||
run: | | ||
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r) | ||
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV | ||
nix-shell --pure --run "echo" ./shell.nix | ||
- name: Test the chart version updater script | ||
run: | | ||
nix-shell --pure --run "./scripts/test-update-chart-version.sh" ./shell.nix | ||
- name: Modify the chart version based on the branch name for develop | ||
run: | | ||
branch_name=${{ github.ref_name }} | ||
nix-shell --pure --run "./scripts/update-chart-version.sh --branch $branch_name --type develop" ./shell.nix | ||
- name: Create Pull Request to develop | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
base: develop | ||
commit-message: "chore(ci): update helm chart versions and/or git submodules" | ||
committer: GitHub <noreply@github.com> | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
title: "Prepare develop branch on ${{ github.ref_name }} creation" | ||
labels: | | ||
update-develop-branch | ||
automated-pr | ||
draft: false | ||
signoff: true | ||
branch: "create-pull-request/patch-develop" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
prepare_release_branch_on_creation: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.ref_type == 'branch' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: cachix/install-nix-action@v22 | ||
- name: Pre-populate nix-shell | ||
run: | | ||
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r) | ||
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV | ||
nix-shell --pure --run "echo" ./shell.nix | ||
- name: Test the chart version updater script | ||
run: | | ||
nix-shell --pure --run "./scripts/test-update-chart-version.sh" ./shell.nix | ||
- name: Modify the chart version based on the branch name for release | ||
run: | | ||
branch_name=${{ github.ref_name }} | ||
nix-shell --pure --run "./scripts/update-chart-version.sh --branch $branch_name --type release" ./shell.nix | ||
- name: Create Pull Request to release | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
base: ${{ github.ref_name }} | ||
commit-message: "chore(ci): update helm chart versions and/or git submodules" | ||
committer: GitHub <noreply@github.com> | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
title: "Prepare ${{ github.ref_name }} branch" | ||
labels: | | ||
prepare-release-branch | ||
automated-pr | ||
draft: false | ||
signoff: true | ||
branch: "create-pull-request/patch-${{ github.ref_name }}" | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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
Oops, something went wrong.