|
59 | 59 | exit 1 |
60 | 60 | fi |
61 | 61 |
|
| 62 | + release-addons-version-check: |
| 63 | + name: ${{ matrix.repo }}-version-check |
| 64 | + runs-on: ubuntu-latest |
| 65 | + strategy: |
| 66 | + fail-fast: false |
| 67 | + matrix: |
| 68 | + repo: [ 'kubeblocks-addons', 'apecloud-addons' ] |
| 69 | + outputs: |
| 70 | + stable-release: ${{ steps.check_stable_version.outputs.stable-release }} |
| 71 | + steps: |
| 72 | + - name: check stable version |
| 73 | + id: check_stable_version |
| 74 | + run: | |
| 75 | + RELEASE_VERSION="${{ inputs.release_version }}" |
| 76 | + STABLE_RELEASE=0 |
| 77 | + if [[ "${RELEASE_VERSION}" =~ ^v[0-9]+(\.[0-9]+)*$ ]]; then |
| 78 | + STABLE_RELEASE=1 |
| 79 | + fi |
| 80 | + echo stable-release="$STABLE_RELEASE" >> $GITHUB_OUTPUT |
| 81 | +
|
| 82 | + - name: checkout ${{ matrix.repo }} ${{ github.ref_name }} code |
| 83 | + if: ${{ steps.check_stable_version.outputs.stable-release == '1' }} |
| 84 | + uses: actions/checkout@v4 |
| 85 | + with: |
| 86 | + token: ${{ env.GITHUB_TOKEN }} |
| 87 | + repository: apecloud/${{ matrix.repo }} |
| 88 | + path: ./ |
| 89 | + ref: ${{ github.ref_name }} |
| 90 | + |
| 91 | + - name: check addon stable versions |
| 92 | + if: ${{ steps.check_stable_version.outputs.stable-release == '1' }} |
| 93 | + run: | |
| 94 | + GIT_BRANCH="${{ github.ref_name }}" |
| 95 | + RELEASE_VERSION="${{ inputs.release_version }}" |
| 96 | + update_release_notes_script=".github/scripts/update_release_notes.py" |
| 97 | + if [[ -f "${update_release_notes_script}" ]]; then |
| 98 | + check_file_log="check_addon_stable_versions.log" |
| 99 | + touch ${check_file_log} |
| 100 | + python3 ${update_release_notes_script} \ |
| 101 | + --git-branch "${GIT_BRANCH}" \ |
| 102 | + --git-tag "${RELEASE_VERSION}" \ |
| 103 | + --dry-run | tee -a ${check_file_log} |
| 104 | + NO_STABLE_VERSION=$(cat "${check_file_log}" | (egrep "No stable addon versions found|Pre-release Versions" || true)) |
| 105 | + if [[ -n "${NO_STABLE_VERSION}" ]]; then |
| 106 | + echo "$(tput -T xterm setaf 1)ERROR: No stable addon versions found!$(tput -T xterm sgr0)" |
| 107 | + exit 1 |
| 108 | + fi |
| 109 | + fi |
| 110 | +
|
| 111 | + send-message-version-check: |
| 112 | + needs: [ release-addons-version-check ] |
| 113 | + if: ${{ (failure() || cancelled()) && needs.release-addons-version-check.outputs.stable-release == '1' }} |
| 114 | + uses: apecloud/apecloud-cd/.github/workflows/[email protected] |
| 115 | + with: |
| 116 | + TYPE: "2" |
| 117 | + CONTENT: "No stable addon versions found, release error" |
| 118 | + APECD_REF: "v0.1.96" |
| 119 | + secrets: inherit |
| 120 | + |
62 | 121 | release-branch: |
63 | | - needs: release-test |
| 122 | + needs: [ release-test, release-addons-version-check ] |
64 | 123 | uses: apecloud/apecloud-cd/.github/workflows/[email protected] |
65 | 124 | with: |
66 | 125 | RELEASE_VERSION: "${{ inputs.release_version }}" |
|
0 commit comments