-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
206 additions
and
352 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,51 +4,22 @@ on: | |
workflow_dispatch: | ||
inputs: | ||
release_version: | ||
description: 'The tag name of release' | ||
required: true | ||
description: 'The version of release' | ||
required: false | ||
default: '' | ||
content: | ||
description: 'The request content' | ||
required: false | ||
default: '' | ||
|
||
run-name: ref_name:${{ github.ref_name }} release_version:${{ inputs.release_version }} | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
PACKAGE_BOT_WEBHOOK: ${{ secrets.PACKAGE_BOT_WEBHOOK }} | ||
|
||
run-name: ref_name:${{ github.ref_name }} release_version:${{ inputs.release_version }} ${{ inputs.content }} | ||
|
||
jobs: | ||
package-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout branch ${{ github.ref_name }} | ||
uses: actions/checkout@v4 | ||
|
||
- name: package message | ||
run: | | ||
bash .github/utils/utils.sh --type 11 \ | ||
--tag-name "${{ inputs.release_version }}" \ | ||
--bot-webhook ${{ env.PACKAGE_BOT_WEBHOOK }} | ||
- name: package check | ||
run: | | ||
bash .github/utils/utils.sh --type 7 --tag-name "${{ inputs.release_version }}" | ||
- name: push tag | ||
uses: mathieudutour/[email protected] | ||
with: | ||
custom_tag: ${{ inputs.release_version }} | ||
github_token: ${{ env.GITHUB_TOKEN }} | ||
tag_prefix: "" | ||
|
||
send-message: | ||
runs-on: ubuntu-latest | ||
needs: package-version | ||
if: ${{ failure() || cancelled() }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: send message | ||
run: | | ||
bash .github/utils/utils.sh --type 12 \ | ||
--tag-name ${{ inputs.release_version }} \ | ||
--content "package\u00a0${{ inputs.release_version }}\u00a0error" \ | ||
--bot-webhook ${{ env.PACKAGE_BOT_WEBHOOK }} \ | ||
--run-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" | ||
uses: apecloud/apecloud-cd/.github/workflows/[email protected] | ||
with: | ||
RELEASE_VERSION: "${{ inputs.release_version }}" | ||
CONTENT: "${{ inputs.content }}" | ||
APECD_REF: "v0.1.38" | ||
BOT_TYPE: "package" | ||
secrets: inherit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ env: | |
RELEASE_BOT_WEBHOOK: ${{ secrets.RELEASE_BOT_WEBHOOK }} | ||
|
||
jobs: | ||
publish: | ||
release-create: | ||
name: create a release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
|
@@ -48,15 +48,11 @@ jobs: | |
run: ./.github/utils/sanitize_release_body.sh | ||
|
||
send-message: | ||
runs-on: ubuntu-latest | ||
needs: publish | ||
needs: [ release-create ] | ||
if: ${{ failure() || cancelled() }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: send message | ||
run: | | ||
bash .github/utils/utils.sh --type 12 \ | ||
--tag-name ${{ needs.publish.outputs.rel-version }} \ | ||
--content "release\u00a0${{ needs.publish.outputs.rel-version }}\u00a0create\u00a0error"\ | ||
--bot-webhook ${{ env.RELEASE_BOT_WEBHOOK }} \ | ||
--run-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" | ||
uses: apecloud/apecloud-cd/.github/workflows/[email protected] | ||
with: | ||
TYPE: "2" | ||
CONTENT: "create release ${{ needs.release-create.outputs.rel-version }} error" | ||
APECD_REF: "v0.1.38" | ||
secrets: inherit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ name: RELEASE-CHART | |
on: | ||
workflow_dispatch: | ||
inputs: | ||
chart_version: | ||
description: 'The version of helm chart' | ||
release_version: | ||
description: 'The release version of helm chart' | ||
required: true | ||
default: '' | ||
release: | ||
|
@@ -18,95 +18,106 @@ env: | |
|
||
|
||
jobs: | ||
chart-version: | ||
release-version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
chart-version: ${{ steps.get_version.outputs.chart_version }} | ||
chart-version-bump: ${{ steps.get_version.outputs.chart_version_bump }} | ||
release-version: ${{ steps.get_release_version.outputs.release_version }} | ||
release-version-bump: ${{ steps.get_release_version.outputs.release_version_bump }} | ||
steps: | ||
- name: Get Chart Version | ||
id: get_version | ||
- name: Get Release Version | ||
id: get_release_version | ||
run: | | ||
VERSION=${{ inputs.chart_version }} | ||
if [ -z "$VERSION" ]; then | ||
VERSION=${{ env.RELEASE_VERSION }} | ||
RELEASE_VERSION=${{ inputs.release_version }} | ||
if [ -z "$RELEASE_VERSION" ]; then | ||
RELEASE_VERSION=${{ env.RELEASE_VERSION }} | ||
fi | ||
echo chart_version=$VERSION >> $GITHUB_OUTPUT | ||
VERSION_BUMP="${VERSION/v/}" | ||
echo chart_version_bump=$VERSION_BUMP >> $GITHUB_OUTPUT | ||
echo release_version=$RELEASE_VERSION >> $GITHUB_OUTPUT | ||
RELEASE_VERSION_BUMP="${RELEASE_VERSION/v/}" | ||
echo release_version_bump=$RELEASE_VERSION_BUMP >> $GITHUB_OUTPUT | ||
release-chart: | ||
needs: chart-version | ||
needs: release-version | ||
uses: apecloud/apecloud-cd/.github/workflows/[email protected] | ||
with: | ||
MAKE_OPS: "bump-chart-ver" | ||
VERSION: "${{ needs.chart-version.outputs.chart-version }}" | ||
VERSION: "${{ needs.release-version.outputs.release-version }}" | ||
CHART_NAME: "kubeblocks" | ||
CHART_DIR: "deploy/helm" | ||
DEP_CHART_DIR: "deploy/helm/depend-charts" | ||
APECD_REF: "v0.1.37" | ||
secrets: inherit | ||
|
||
release-addons-chart: | ||
needs: chart-version | ||
uses: apecloud/apecloud-cd/.github/workflows/[email protected].37 | ||
needs: release-version | ||
uses: apecloud/apecloud-cd/.github/workflows/[email protected].38 | ||
with: | ||
GITHUB_REPO: "apecloud/kubeblocks-addons" | ||
VERSION: "${{ needs.chart-version.outputs.chart-version }}" | ||
VERSION: "${{ needs.release-version.outputs.release-version }}" | ||
CHART_DIR: "addons" | ||
APECD_REF: "v0.1.37" | ||
APECD_REF: "v0.1.38" | ||
GITHUB_REF: ${{ github.ref }} | ||
secrets: inherit | ||
|
||
release-charts-image: | ||
needs: [ chart-version, release-chart, release-addons-chart ] | ||
needs: [ release-version, release-chart, release-addons-chart ] | ||
uses: apecloud/apecloud-cd/.github/workflows/[email protected] | ||
with: | ||
MAKE_OPS_PRE: "helm-package VERSION=${{ needs.chart-version.outputs.chart-version-bump }}" | ||
MAKE_OPS_PRE: "helm-package VERSION=${{ needs.release-version.outputs.release-version-bump }}" | ||
IMG: "apecloud/kubeblocks-charts" | ||
VERSION: "${{ needs.chart-version.outputs.chart-version }}" | ||
VERSION: "${{ needs.release-version.outputs.release-version }}" | ||
GO_VERSION: "1.21" | ||
APECD_REF: "v0.1.24" | ||
DOCKERFILE_PATH: "./docker/Dockerfile-charts" | ||
secrets: inherit | ||
|
||
send-message: | ||
release-message: | ||
runs-on: ubuntu-latest | ||
needs: release-charts-image | ||
outputs: | ||
content-result: ${{ steps.release_message.outputs.content_result }} | ||
release-version: ${{ steps.release_message.outputs.release_version }} | ||
if: ${{ always() && github.event.action == 'published' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: send message | ||
id: send_message | ||
- name: release message | ||
id: release_message | ||
run: | | ||
release_result="${{ env.RELEASE_VERSION }}-chart" | ||
touch ${release_result} | ||
echo 'release-result='${release_result} >> $GITHUB_OUTPUT | ||
ARTIFACT_KEY="${{ env.RELEASE_VERSION }}-chart" | ||
touch ${ARTIFACT_KEY} | ||
echo 'artifact_key='${ARTIFACT_KEY} >> $GITHUB_OUTPUT | ||
CONTENT="release\u00a0${{ env.RELEASE_VERSION }}\u00a0chart\u00a0error" | ||
CONTENT="error" | ||
if [[ "${{ needs.release-charts-image.result }}" == "success" ]]; then | ||
CONTENT="release\u00a0${{ env.RELEASE_VERSION }}\u00a0chart\u00a0success" | ||
echo "success" > ${release_result} | ||
CONTENT="success" | ||
echo "success" > ${ARTIFACT_KEY} | ||
else | ||
echo "error" > ${release_result} | ||
echo "error" > ${ARTIFACT_KEY} | ||
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" | ||
echo 'content_result='$CONTENT >> $GITHUB_OUTPUT | ||
echo release_version=${{ env.RELEASE_VERSION }} >> $GITHUB_OUTPUT | ||
- name: delete cache | ||
continue-on-error: true | ||
run: | | ||
bash .github/utils/utils.sh --type 17 --tag-name "${{ steps.send_message.outputs.release-result }}" | ||
bash .github/utils/utils.sh --type 17 --tag-name "${{ steps.release_message.outputs.artifact_key }}" | ||
- 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 }} | ||
${{ steps.release_message.outputs.artifact_key }} | ||
key: ${{ steps.release_message.outputs.artifact_key }} | ||
|
||
send-message: | ||
needs: [ release-message ] | ||
if: ${{ always() && github.event.action == 'published' }} | ||
uses: apecloud/apecloud-cd/.github/workflows/[email protected] | ||
with: | ||
TYPE: "2" | ||
CONTENT: "release chart ${{ needs.release-message.outputs.release-version }} ${{ needs.release-message.outputs.content-result }}" | ||
APECD_REF: "v0.1.38" | ||
secrets: inherit | ||
|
||
|
||
|
Oops, something went wrong.