@@ -41,12 +41,21 @@ jobs:
41
41
runs-on : ubuntu-latest
42
42
43
43
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
+
44
52
- name : Release MCAD
45
53
run : |
46
54
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 }}
47
55
env :
48
56
GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
49
57
shell : bash
58
+ if : ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }}
50
59
51
60
- name : Wait for MCAD run to finish
52
61
run : |
@@ -57,18 +66,28 @@ jobs:
57
66
env :
58
67
GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
59
68
shell : bash
69
+ if : ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }}
60
70
61
71
release-instascale :
62
72
needs : release-mcad
63
73
runs-on : ubuntu-latest
64
74
65
75
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
+
66
84
- name : Release InstaScale
67
85
run : |
68
86
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 }}
69
87
env :
70
88
GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
71
89
shell : bash
90
+ if : ${{ env.INSTASCALE_RELEASE_STATUS_CODE != '200' }}
72
91
73
92
- name : Wait for InstaScale run to finish
74
93
run : |
@@ -79,11 +98,20 @@ jobs:
79
98
env :
80
99
GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
81
100
shell : bash
101
+ if : ${{ env.INSTASCALE_RELEASE_STATUS_CODE != '200' }}
82
102
83
103
release-codeflare-sdk :
84
104
runs-on : ubuntu-latest
85
105
86
106
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
+
87
115
- name : Release CodeFlare SDK
88
116
run : |
89
117
semver_version="${{ github.event.inputs.codeflare-sdk-version }}"
92
120
env :
93
121
GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
94
122
shell : bash
123
+ if : ${{ env.SDK_RELEASE_STATUS_CODE != '200' }}
95
124
96
125
- name : Wait for CodeFlare SDK run to finish
97
126
run : |
@@ -102,6 +131,7 @@ jobs:
102
131
env :
103
132
GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
104
133
shell : bash
134
+ if : ${{ env.SDK_RELEASE_STATUS_CODE != '200' }}
105
135
106
136
release-codeflare-operator :
107
137
needs : [release-mcad, release-instascale, release-codeflare-sdk]
0 commit comments