Skip to content

Commit

Permalink
Cherry-pick CI changes (#583)
Browse files Browse the repository at this point in the history
* ci: enhance pull_request workflow (#557)

* ci: enhance pull_request workflow

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: use ct via nix-shell,

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: add the csi-driver step

Signed-off-by: Abhinandan Purkait <[email protected]>

* fix: the release regex

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: remove test.test binary

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: add gitignore entry for .test files

Signed-off-by: Abhinandan Purkait <[email protected]>

* fix: remove redundant die method

Signed-off-by: Abhinandan Purkait <[email protected]>

* fix: set analytics to be disabled on ci

Signed-off-by: Abhinandan Purkait <[email protected]>

* fix: shebang, condition check, script input

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: move zfs env setup inside nix

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: get IMAGE_TAG from chart

Signed-off-by: Abhinandan Purkait <[email protected]>

* ci: disable the chart releaser workflow temporarily

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: don't use yq for extracting version in Makefile

Signed-off-by: Abhinandan Purkait <[email protected]>

---------

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: replace CRD with auto-generated copy (#564)

Signed-off-by: Niladri Halder <[email protected]>

* ci: enhance build.yml workflow

Signed-off-by: Abhinandan Purkait <[email protected]>

* ci: add branch preparation and release CI changes (#567)

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: cleanup unused scripts, update make manifests (#569)

* chore: cleanup unused scripts, update make manifets

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: generate operator from helm template

Signed-off-by: Abhinandan Purkait <[email protected]>

* ci: add manifests and codegen validation in pull request

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: add comments on the generate-manifests script

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: generate zfs-operator by disabling helm labels

Signed-off-by: Abhinandan Purkait <[email protected]>

---------

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: set version to prerelease

Signed-off-by: Abhinandan Purkait <[email protected]>

---------

Signed-off-by: Abhinandan Purkait <[email protected]>
Signed-off-by: Niladri Halder <[email protected]>
Co-authored-by: Niladri Halder <[email protected]>
  • Loading branch information
Abhinandan-Purkait and niladrih authored Sep 10, 2024
1 parent 6b45797 commit 072a69f
Show file tree
Hide file tree
Showing 44 changed files with 2,710 additions and 2,863 deletions.
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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

0 comments on commit 072a69f

Please sign in to comment.