@@ -41,12 +41,21 @@ jobs:
4141 runs-on : ubuntu-latest
4242
4343 steps :
44+ - name : Check if MCAD release does exist
45+ run : |
46+ status_code=$(curl -s -o /dev/null -w "%{http_code}" https://github.com/project-codeflare/multi-cluster-app-dispatcher/releases/tag/${{ github.event.inputs.mcad-version }})
47+ if [[ "$status_code" == "200" ]]; then
48+ echo "MCAD release with version ${{ github.event.inputs.mcad-version }} already exist. Will not create MCAD release."
49+ fi
50+ echo "MCAD_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV
51+
4452 - name : Release MCAD
4553 run : |
4654 gh workflow run mcad-release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/multi-cluster-app-dispatcher --ref ${{ github.ref }} --field tag=${{ github.event.inputs.mcad-version }} --field quay-organization=${{ github.event.inputs.quay-organization }}
4755 env :
4856 GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
4957 shell : bash
58+ if : ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }}
5059
5160 - name : Wait for MCAD run to finish
5261 run : |
@@ -57,18 +66,28 @@ jobs:
5766 env :
5867 GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
5968 shell : bash
69+ if : ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }}
6070
6171 release-instascale :
6272 needs : release-mcad
6373 runs-on : ubuntu-latest
6474
6575 steps :
76+ - name : Check if Instascale release does exist
77+ run : |
78+ status_code=$(curl -s -o /dev/null -w "%{http_code}" https://github.com/project-codeflare/instascale/releases/tag/${{ github.event.inputs.instascale-version }})
79+ if [[ "$status_code" == "200" ]]; then
80+ echo "Instascale release with version ${{ github.event.inputs.instascale-version }} already exist. Will not create Instascale release."
81+ fi
82+ echo "INSTASCALE_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV
83+
6684 - name : Release InstaScale
6785 run : |
6886 gh workflow run instascale-release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/instascale --ref ${{ github.ref }} --field is-stable=${{ github.event.inputs.is-stable }} --field tag=${{ github.event.inputs.instascale-version }} --field mcad-version=${{ github.event.inputs.mcad-version }} --field quay-organization=${{ github.event.inputs.quay-organization }}
6987 env :
7088 GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
7189 shell : bash
90+ if : ${{ env.INSTASCALE_RELEASE_STATUS_CODE != '200' }}
7291
7392 - name : Wait for InstaScale run to finish
7493 run : |
@@ -79,11 +98,20 @@ jobs:
7998 env :
8099 GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
81100 shell : bash
101+ if : ${{ env.INSTASCALE_RELEASE_STATUS_CODE != '200' }}
82102
83103 release-codeflare-sdk :
84104 runs-on : ubuntu-latest
85105
86106 steps :
107+ - name : Check if Codeflare SDK release does exist
108+ run : |
109+ status_code=$(curl -s -o /dev/null -w "%{http_code}" https://github.com/project-codeflare/codeflare-sdk/releases/tag/${{ github.event.inputs.codeflare-sdk-version }})
110+ if [[ "$status_code" == "200" ]]; then
111+ echo "SDK release with version ${{ github.event.inputs.codeflare-sdk-version }} already exist. Will not create SDK release."
112+ fi
113+ echo "SDK_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV
114+
87115 - name : Release CodeFlare SDK
88116 run : |
89117 semver_version="${{ github.event.inputs.codeflare-sdk-version }}"
92120 env :
93121 GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
94122 shell : bash
123+ if : ${{ env.SDK_RELEASE_STATUS_CODE != '200' }}
95124
96125 - name : Wait for CodeFlare SDK run to finish
97126 run : |
@@ -102,6 +131,7 @@ jobs:
102131 env :
103132 GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
104133 shell : bash
134+ if : ${{ env.SDK_RELEASE_STATUS_CODE != '200' }}
105135
106136 release-codeflare-operator :
107137 needs : [release-mcad, release-instascale, release-codeflare-sdk]
0 commit comments