ref_name:release-0.9 release_version:v0.9.5-beta.8 #22
This file contains hidden or 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: Releae Tag | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| VERSION: | |
| description: 'The version of release' | |
| required: false | |
| default: '' | |
| RELEASE_VERSION: | |
| description: 'The version of release' | |
| required: false | |
| default: '' | |
| workflow_call: | |
| inputs: | |
| VERSION: | |
| description: 'The version of release' | |
| required: false | |
| type: string | |
| default: '' | |
| RELEASE_VERSION: | |
| description: 'The version of release' | |
| required: false | |
| type: string | |
| default: '' | |
| run-name: ref_name:${{ github.ref_name }} release_version:${{ inputs.VERSION }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| HELM_VERSION: v3.13.1 | |
| CUR_BRANCH: ${{ vars.CURRENT_RELEASE_BRANCH }} | |
| jobs: | |
| release-tag: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install Helm | |
| uses: azure/setup-helm@v3 | |
| with: | |
| version: ${{ env.HELM_VERSION }} | |
| - name: checkout branch ${{ env.CUR_BRANCH }} | |
| if: ${{ inputs.RELEASE_VERSION == '' && env.CUR_BRANCH != '' }} | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| ref: ${{ env.CUR_BRANCH }} | |
| fetch-depth: 0 | |
| - name: checkout branch ${{ github.ref_name }} | |
| if: ${{ inputs.RELEASE_VERSION != '' || env.CUR_BRANCH == '' }} | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| fetch-depth: 0 | |
| - name: build kbcli embed chart | |
| id: build-kbcli-embed-chart | |
| run: | | |
| RELEASE_COMMIT_SHA="$(git rev-parse HEAD)" | |
| make build-kbcli-embed-chart | |
| git add pkg/cluster/charts | |
| FILE_CHANGES=`git diff --name-only ${RELEASE_COMMIT_SHA} | (grep "pkg/cluster/charts" || true)` | |
| if [[ ! -z "$FILE_CHANGES" ]]; then | |
| echo $FILE_CHANGES | |
| git config --local user.name "$GITHUB_ACTOR" | |
| git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| git commit -a -m "chore: auto update kbcli embed chart changes" | |
| fi | |
| echo file_changes=$FILE_CHANGES >> $GITHUB_OUTPUT | |
| RELEASE_COMMIT="$(git rev-parse HEAD)" | |
| echo 'RELEASE_COMMIT='${RELEASE_COMMIT} >> $GITHUB_ENV | |
| - name: push kbcli embed chart changes to new branch | |
| if: ${{ steps.build-kbcli-embed-chart.outputs.file_changes && github.ref_name == 'main' }} | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ env.GITHUB_TOKEN }} | |
| branch: support/auto-update-kbcli-${{ env.RELEASE_COMMIT }} | |
| - name: auto create pr head new branch | |
| if: ${{ steps.build-kbcli-embed-chart.outputs.file_changes && github.ref_name == 'main' }} | |
| run: | | |
| gh pr create --head "support/auto-update-kbcli-${{ env.RELEASE_COMMIT }}" --title "chore: auto update kbcli embed chart changes" --body "" | |
| - name: push kbcli embed chart changes | |
| uses: ad-m/github-push-action@master | |
| if: ${{ steps.build-kbcli-embed-chart.outputs.file_changes && github.ref_name != 'main' }} | |
| with: | |
| github_token: ${{ env.GITHUB_TOKEN }} | |
| branch: ${{ github.ref }} | |
| - name: push tag ${{ inputs.VERSION }} | |
| uses: mathieudutour/github-tag-action@v6.1 | |
| with: | |
| custom_tag: ${{ inputs.VERSION }} | |
| github_token: ${{ env.GITHUB_TOKEN }} | |
| commit_sha: ${{ env.RELEASE_COMMIT }} | |
| tag_prefix: "" | |
| send-message: | |
| needs: [ release-tag ] | |
| if: ${{ failure() || cancelled() }} | |
| uses: apecloud/apecloud-cd/.github/workflows/feishui-message.yml@v0.1.49 | |
| with: | |
| TYPE: "2" | |
| CONTENT: "release tag ${{ inputs.VERSION }} error" | |
| APECD_REF: "v0.1.49" | |
| secrets: inherit | |