Skip to content

chore(bors): merge pull request #592 #160

chore(bors): merge pull request #592

chore(bors): merge pull request #592 #160

Workflow file for this run

name: Release Helm Chart
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+**'
branches:
- 'release/**'
jobs:
release-chart:
runs-on: ubuntu-latest
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" ./scripts/helm/shell.nix
- name: Publish locally in the workspace
run: |
if [ "${{ github.ref_type }}" == "tag" ]; then
tag="${{ github.ref_name }}"
# Publish the Chart.yaml locally
# Note this does not commit the Chart.yaml changes this the branch
nix-shell --pure --run "./scripts/helm/publish-chart-yaml.sh --app-tag "$tag"" ./scripts/helm/shell.nix
else
branch="${{ github.ref_name }}"
nix-shell --pure --run "./scripts/helm/publish-chart-yaml.sh --check-chart "$branch"" ./scripts/helm/shell.nix
fi
nix-shell --pure --run "SKIP_GIT=1 ./scripts/helm/generate-readme.sh" ./scripts/helm/shell.nix
- name: Publish Mayastor Helm chart
uses: stefanprodan/helm-gh-pages@v1.7.0
if: ${{ github.ref_type == 'tag' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
charts_dir: .
update-chart:
runs-on: ubuntu-latest
if: ${{ github.ref_type == 'tag' }}
needs:
- release-chart
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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" ./scripts/helm/shell.nix
- name: Publish locally in the workspace
run: |
tag="${{ github.ref_name }}"
BASE_REF="${{ github.event.base_ref }}"
BRANCH="${BASE_REF#refs/heads/}"
nix-shell --pure --run "./scripts/helm/publish-chart-yaml.sh --released "$tag" --released-branch "$BRANCH"" ./scripts/helm/shell.nix
nix-shell --pure --run "SKIP_GIT=1 ./scripts/helm/generate-readme.sh" ./scripts/helm/shell.nix
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
commit-message: "chore(ci): update future helm chart versions"
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
title: Bump future helm chart version on the release branch
labels: |
update-release-branch
automated-pr
draft: false
signoff: true
delete-branch: true
branch-suffix: "random"
base: ${{ github.event.base_ref }}
token: ${{ secrets.ORG_CI_GITHUB }}
- name: Approve Pull Request by CI Bot
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
gh pr review ${{ steps.cpr.outputs.pull-request-number }} --approve
env:
GH_TOKEN: ${{ github.token }}
- name: Approve Pull Request by CI User
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
gh pr review ${{ steps.cpr.outputs.pull-request-number }} --approve
env:
GH_TOKEN: ${{ secrets.ORG_CI_GITHUB_2 }}
- name: Bors Merge Pull Request
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
gh pr comment ${{ steps.cpr.outputs.pull-request-number }} --body "bors merge"
env:
GH_TOKEN: ${{ secrets.ORG_CI_GITHUB }}