Release Charts #494
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: RELEASE-CHART | |
on: | |
workflow_dispatch: | |
inputs: | |
chart_version: | |
description: 'The version of helm chart' | |
required: true | |
default: '' | |
release: | |
types: | |
- published | |
env: | |
GH_TOKEN: ${{ github.token }} | |
RELEASE_VERSION: ${{ github.ref_name }} | |
RELEASE_BOT_WEBHOOK: ${{ secrets.RELEASE_BOT_WEBHOOK }} | |
jobs: | |
chart-version: | |
runs-on: ubuntu-latest | |
outputs: | |
chart-version: ${{ steps.get_version.outputs.chart_version }} | |
chart-version-bump: ${{ steps.get_version.outputs.chart_version_bump }} | |
steps: | |
- name: Get Chart Version | |
id: get_version | |
run: | | |
VERSION=${{ inputs.chart_version }} | |
if [ -z "$VERSION" ]; then | |
VERSION=${{ env.RELEASE_VERSION }} | |
fi | |
echo chart_version=$VERSION >> $GITHUB_OUTPUT | |
VERSION_BUMP="${VERSION/v/}" | |
echo chart_version_bump=$VERSION_BUMP >> $GITHUB_OUTPUT | |
release-chart: | |
needs: chart-version | |
uses: apecloud/apecloud-cd/.github/workflows/release-charts.yml@v0.1.12 | |
with: | |
MAKE_OPS: "bump-chart-ver" | |
VERSION: "${{ needs.chart-version.outputs.chart-version }}" | |
CHART_NAME: "kubeblocks" | |
CHART_DIR: "deploy/helm" | |
DEP_CHART_DIR: "deploy/helm/depend-charts" | |
APECD_REF: "v0.1.12" | |
secrets: inherit | |
release-charts-image: | |
needs: [ chart-version, release-chart ] | |
uses: apecloud/apecloud-cd/.github/workflows/release-image-cache.yml@v0.1.12 | |
with: | |
MAKE_OPS_PRE: "helm-package VERSION=${{ needs.chart-version.outputs.chart-version-bump }}" | |
IMG: "apecloud/kubeblocks-charts" | |
VERSION: "${{ needs.chart-version.outputs.chart-version }}" | |
GO_VERSION: "1.20.5" | |
APECD_REF: "v0.1.12" | |
DOCKERFILE_PATH: "./docker/Dockerfile-charts" | |
secrets: inherit | |
send-message: | |
runs-on: ubuntu-latest | |
needs: release-charts-image | |
if: ${{ always() && github.event.action == 'published' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: send message | |
id: send_message | |
run: | | |
release_result="${{ env.RELEASE_VERSION }}-chart" | |
touch ${release_result} | |
echo 'release-result='${release_result} >> $GITHUB_OUTPUT | |
CONTENT="release\u00a0${{ env.RELEASE_VERSION }}\u00a0chart\u00a0error" | |
if [[ "${{ needs.release-charts-image.result }}" == "success" ]]; then | |
CONTENT="release\u00a0${{ env.RELEASE_VERSION }}\u00a0chart\u00a0success" | |
echo "success" > ${release_result} | |
else | |
echo "error" > ${release_result} | |
fi | |
bash .github/utils/utils.sh --type 12 \ | |
--tag-name ${{ env.RELEASE_VERSION }} \ | |
--content "${CONTENT}"\ | |
--bot-webhook ${{ env.RELEASE_BOT_WEBHOOK }} \ | |
--run-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" | |
- name: delete cache | |
continue-on-error: true | |
run: | | |
bash .github/utils/utils.sh --type 17 --tag-name "${{ steps.send_message.outputs.release-result }}" | |
- name: Save Artifact | |
id: cache-artifact-save | |
uses: actions/cache/save@v3 | |
with: | |
path: | | |
${{ steps.send_message.outputs.release-result }} | |
key: ${{ steps.send_message.outputs.release-result }} | |