Skip to content

KubeBlocks v0.9.1-beta.27 #224

KubeBlocks v0.9.1-beta.27

KubeBlocks v0.9.1-beta.27 #224

Workflow file for this run

name: Release KubeBlocks Install And Crds Yaml
on:
workflow_dispatch:
inputs:
RELEASE_VERSION:
description: 'The version of release'
required: false
default: ''
release:
types:
- published
env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
JIHULAB_KUBEBLOCKS_PROJECT_ID: 98723
JIHULAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}
HELM_VERSION: v3.14.3
jobs:
release-version:
name: release version ${{ inputs.RELEASE_VERSION }}
runs-on: ubuntu-latest
outputs:
release-version: ${{ steps.get_release_version.outputs.release-version }}
steps:
- name: Get Release Version
id: get_release_version
run: |
RELEASE_VERSION="${{ inputs.RELEASE_VERSION }}"
if [[ -z "$RELEASE_VERSION" ]]; then
RELEASE_VERSION="${{ github.ref_name }}"
fi
echo release-version=$RELEASE_VERSION >> $GITHUB_OUTPUT
create-jihulab-release:
name: Create Release KubeBlocks Jihulab
needs: [ release-version ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: create jihulab release
run: |
bash ${{ github.workspace }}/.github/utils/release_gitlab.sh \
--type 1 \
--project-id ${{ env.JIHULAB_KUBEBLOCKS_PROJECT_ID }} \
--tag-name "${{ needs.release-version.outputs.release-version }}" \
--access-token ${{ env.JIHULAB_ACCESS_TOKEN }}
upload-kubeblocks-yaml:
needs: [ release-version, create-jihulab-release ]
strategy:
fail-fast: false
matrix:
yaml: [ 'kubeblocks_crds.yaml', 'kubeblocks.yaml' ]
name: Upload ${{ matrix.yaml }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Helm
if: ${{ matrix.yaml == 'kubeblocks.yaml' }}
uses: azure/setup-helm@v4
with:
version: ${{ env.HELM_VERSION }}
- name: generate KubeBlocks yaml
if: ${{ matrix.yaml == 'kubeblocks.yaml' }}
run: |
BUMP_VERSION="${{ needs.release-version.outputs.release-version }}"
if [[ "$BUMP_VERSION" == "v"* ]]; then
BUMP_VERSION="${BUMP_VERSION/v/}"
fi
make bump-chart-ver VERSION="${BUMP_VERSION}"
touch ${{ matrix.yaml }}
helm template kubeblocks deploy/helm --dependency-update > ${{ matrix.yaml }}
- name: merge KubeBlocks crds
if: ${{ matrix.yaml == 'kubeblocks_crds.yaml' }}
run: |
touch ${{ matrix.yaml }}
crds_path="deploy/helm/crds"
crds_list=$(ls $crds_path)
for crd in $(echo $crds_list); do
echo "---" >> ${{ matrix.yaml }}
cat $crds_path/$crd >> ${{ matrix.yaml }}
done
- name: upload KubeBlocks yaml to jihulab
run: |
echo "Processing file: ${{ matrix.yaml }}"
bash ${{ github.workspace }}/.github/utils/release_gitlab.sh \
--type 2 \
--project-id ${{ env.JIHULAB_KUBEBLOCKS_PROJECT_ID }} \
--tag-name "${{ needs.release-version.outputs.release-version }}" \
--asset-path ${{ github.workspace }}/${{ matrix.yaml }} \
--asset-name ${{ matrix.yaml }} \
--access-token ${{ env.JIHULAB_ACCESS_TOKEN }}
- name: get KubeBlocks release upload url
run: |
echo 'UPLOAD_URL='`bash ${{ github.workspace }}/.github/utils/utils.sh \
--tag-name "${{ needs.release-version.outputs.release-version }}" \
--type 3 \
--github-repo ${{ github.repository }} \
--github-token ${{ env.GITHUB_TOKEN }}` >> $GITHUB_ENV
- name: upload KubeBlocks yaml to github
uses: actions/upload-release-asset@main
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ${{ github.workspace }}/${{ matrix.yaml }}
asset_name: ${{ matrix.yaml }}
asset_content_type: application/yaml