Skip to content

Commit

Permalink
chore: release install KubeBlocks yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
JashBook committed Apr 10, 2024
1 parent 3a47ed1 commit fbcd5c7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 34 deletions.
60 changes: 41 additions & 19 deletions .github/workflows/release-crds.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Crds
name: Release KubeBlocks Install And Crds Yaml

on:
workflow_dispatch:
Expand All @@ -17,7 +17,7 @@ env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
JIHULAB_KUBEBLOCKS_PROJECT_ID: 98723
JIHULAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}
KUBEBLOCKS_CRDS: "kubeblocks_crds.yaml"
HELM_VERSION: v3.14.3

jobs:
release-version:
Expand All @@ -29,11 +29,11 @@ jobs:
- name: Get Release Version
id: get_release_version
run: |
RELASE_VERSION="${{ inputs.RELEASE_VERSION }}"
if [[ -z "$RELASE_VERSION" ]]; then
RELASE_VERSION="${{ github.ref_name }}"
RELEASE_VERSION="${{ inputs.RELEASE_VERSION }}"
if [[ -z "$RELEASE_VERSION" ]]; then
RELEASE_VERSION="${{ github.ref_name }}"
fi
echo release-version=$RELASE_VERSION >> $GITHUB_OUTPUT
echo release-version=$RELEASE_VERSION >> $GITHUB_OUTPUT
create-jihulab-release:
name: Create Release KubeBlocks Jihulab
Expand All @@ -49,32 +49,54 @@ jobs:
--tag-name "${{ needs.release-version.outputs.release-version }}" \
--access-token ${{ env.JIHULAB_ACCESS_TOKEN }}
upload-kubeblocks-crds:
upload-kubeblocks-yaml:
needs: [ release-version, create-jihulab-release ]
name: Upload KubeBlocks crds
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"
KUBEBLOCKS_CRDS=${{ env.KUBEBLOCKS_CRDS }}
touch $KUBEBLOCKS_CRDS
crds_list=$(ls $crds_path)
for crd in $(echo $crds_list); do
echo "---" >> $KUBEBLOCKS_CRDS
cat $crds_path/$crd >> $KUBEBLOCKS_CRDS
echo "---" >> ${{ matrix.yaml }}
cat $crds_path/$crd >> ${{ matrix.yaml }}
done
- name: upload KubeBlocks crds to jihulab
- name: upload KubeBlocks yaml to jihulab
run: |
echo "Processing file: ${{ env.KUBEBLOCKS_CRDS }}"
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 }}/${{ env.KUBEBLOCKS_CRDS }} \
--asset-name ${{ env.KUBEBLOCKS_CRDS }} \
--asset-path ${{ github.workspace }}/${{ matrix.yaml }} \
--asset-name ${{ matrix.yaml }} \
--access-token ${{ env.JIHULAB_ACCESS_TOKEN }}
- name: get KubeBlocks release upload url
Expand All @@ -85,10 +107,10 @@ jobs:
--github-repo ${{ github.repository }} \
--github-token ${{ env.GITHUB_TOKEN }}` >> $GITHUB_ENV
- name: upload KubeBlocks crds to github
- name: upload KubeBlocks yaml to github
uses: actions/upload-release-asset@main
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ${{ github.workspace }}/${{ env.KUBEBLOCKS_CRDS }}
asset_name: ${{ env.KUBEBLOCKS_CRDS }}
asset_path: ${{ github.workspace }}/${{ matrix.yaml }}
asset_name: ${{ matrix.yaml }}
asset_content_type: application/yaml
15 changes: 0 additions & 15 deletions deploy/helm/templates/tests/test-connection.yaml

This file was deleted.

0 comments on commit fbcd5c7

Please sign in to comment.