Skip to content

Commit b804fd7

Browse files
committed
[263] Release Action can skip intermediate steps
1 parent 65b8889 commit b804fd7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/project-codeflare-release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,18 @@ 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+
echo "MCAD_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV
48+
4449
- name: Release MCAD
4550
run: |
4651
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 }}
4752
env:
4853
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
4954
shell: bash
55+
if: ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }}
5056

5157
- name: Wait for MCAD run to finish
5258
run: |
@@ -57,18 +63,25 @@ jobs:
5763
env:
5864
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
5965
shell: bash
66+
if: ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }}
6067

6168
release-instascale:
6269
needs: release-mcad
6370
runs-on: ubuntu-latest
6471

6572
steps:
73+
- name: Check if Instascale release does exist
74+
run: |
75+
status_code=$(curl -s -o /dev/null -w "%{http_code}" https://github.com/project-codeflare/instascale/releases/tag/${{ github.event.inputs.instascale-version }})
76+
echo "INSTASCALE_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV
77+
6678
- name: Release InstaScale
6779
run: |
6880
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 }}
6981
env:
7082
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
7183
shell: bash
84+
if: ${{ env.INSTASCALE_RELEASE_STATUS_CODE != '200' }}
7285

7386
- name: Wait for InstaScale run to finish
7487
run: |
@@ -79,11 +92,17 @@ jobs:
7992
env:
8093
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
8194
shell: bash
95+
if: ${{ env.INSTASCALE_RELEASE_STATUS_CODE != '200' }}
8296

8397
release-codeflare-sdk:
8498
runs-on: ubuntu-latest
8599

86100
steps:
101+
- name: Check if Codeflare SDK release does exist
102+
run: |
103+
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 }})
104+
echo "SDK_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV
105+
87106
- name: Release CodeFlare SDK
88107
run: |
89108
semver_version="${{ github.event.inputs.codeflare-sdk-version }}"
@@ -92,6 +111,7 @@ jobs:
92111
env:
93112
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
94113
shell: bash
114+
if: ${{ env.SDK_RELEASE_STATUS_CODE != '200' }}
95115

96116
- name: Wait for CodeFlare SDK run to finish
97117
run: |
@@ -102,6 +122,7 @@ jobs:
102122
env:
103123
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
104124
shell: bash
125+
if: ${{ env.SDK_RELEASE_STATUS_CODE != '200' }}
105126

106127
release-codeflare-operator:
107128
needs: [release-mcad, release-instascale, release-codeflare-sdk]

0 commit comments

Comments
 (0)