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

Cherry-pick CI changes #583

Merged
merged 6 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
131 changes: 131 additions & 0 deletions .github/workflows/branch_preparation.yml
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 }}
Loading
Loading