diff --git a/.github/workflows/project-codeflare-release.yml b/.github/workflows/project-codeflare-release.yml index 50fc26ae..017c7b02 100644 --- a/.github/workflows/project-codeflare-release.yml +++ b/.github/workflows/project-codeflare-release.yml @@ -10,15 +10,9 @@ on: replaces: description: 'The previous operator semantic version that this release replaces (for example: v0.0.0)' required: true - mcad-version: - description: 'Version of multi-cluster-app-dispatcher to be released (for example: v0.0.0)' - required: true codeflare-sdk-version: description: 'Version of CodeFlare-SDK to be released (for example: v0.0.0)' required: true - instascale-version: - description: 'Version of InstaScale to be released (for example: v0.0.0)' - required: true kuberay-version: description: 'Tested version of KubeRay (for example: v0.0.0)' required: true @@ -48,79 +42,13 @@ jobs: echo "Below are the release parameters set for the workflow:" echo "Operator Version: ${{ github.event.inputs.operator-version }}" echo "Replaces: ${{ github.event.inputs.replaces }}" - echo "MCAD Version: ${{ github.event.inputs.mcad-version }}" echo "CodeFlare SDK Version: ${{ github.event.inputs.codeflare-sdk-version }}" - echo "InstaScale Version: ${{ github.event.inputs.instascale-version }}" echo "Tested KubeRay Version: ${{ github.event.inputs.kuberay-version }}" echo "Is Stable: ${{ github.event.inputs.is-stable }}" echo "CodeFlare Repository Organization: ${{ github.event.inputs.codeflare-repository-organization }}" echo "Quay Organization: ${{ github.event.inputs.quay-organization }}" echo "Community Operators Prod Organization: ${{ github.event.inputs.community-operators-prod-organization }}" - release-mcad: - needs: check-kuberay-version - runs-on: ubuntu-latest - - steps: - - name: Check if MCAD release does exist - run: | - 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 }}) - if [[ "$status_code" == "200" ]]; then - echo "MCAD release with version ${{ github.event.inputs.mcad-version }} already exist. Will not create MCAD release." - fi - echo "MCAD_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV - - - name: Release MCAD - run: | - gh workflow run mcad-release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/multi-cluster-app-dispatcher --ref go-1.20 --field tag=${{ github.event.inputs.mcad-version }} - env: - GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} - shell: bash - if: ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }} - - - name: Wait for MCAD run to finish - run: | - # wait for a while for Run to be started - sleep 5 - run_id=$(gh run list --workflow mcad-release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/multi-cluster-app-dispatcher --limit 1 --json databaseId --jq .[].databaseId) - gh run watch ${run_id} --repo ${{ github.event.inputs.codeflare-repository-organization }}/multi-cluster-app-dispatcher --interval 10 --exit-status - env: - GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} - shell: bash - if: ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }} - - release-instascale: - needs: release-mcad - runs-on: ubuntu-latest - - steps: - - name: Check if Instascale release does exist - run: | - status_code=$(curl -s -o /dev/null -w "%{http_code}" https://github.com/project-codeflare/instascale/releases/tag/${{ github.event.inputs.instascale-version }}) - if [[ "$status_code" == "200" ]]; then - echo "Instascale release with version ${{ github.event.inputs.instascale-version }} already exist. Will not create Instascale release." - fi - echo "INSTASCALE_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV - - - name: Release InstaScale - run: | - gh workflow run instascale-release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/instascale --ref ${{ github.ref }} --field tag=${{ github.event.inputs.instascale-version }} --field mcad-version=${{ github.event.inputs.mcad-version }} - env: - GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} - shell: bash - if: ${{ env.INSTASCALE_RELEASE_STATUS_CODE != '200' }} - - - name: Wait for InstaScale run to finish - run: | - # wait for a while for Run to be started - sleep 5 - run_id=$(gh run list --workflow instascale-release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/instascale --limit 1 --json databaseId --jq .[].databaseId) - gh run watch ${run_id} --repo ${{ github.event.inputs.codeflare-repository-organization }}/instascale --interval 10 --exit-status - env: - GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} - shell: bash - if: ${{ env.INSTASCALE_RELEASE_STATUS_CODE != '200' }} - release-codeflare-sdk: needs: check-kuberay-version runs-on: ubuntu-latest @@ -156,13 +84,13 @@ jobs: if: ${{ env.SDK_RELEASE_STATUS_CODE != '200' }} release-codeflare-operator: - needs: [release-mcad, release-instascale, release-codeflare-sdk] + needs: [release-codeflare-sdk] runs-on: ubuntu-latest steps: - name: Release CodeFlare operator run: | - gh workflow run tag-and-build.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/codeflare-operator --ref ${{ github.ref }} --field is-stable=${{ github.event.inputs.is-stable }} --field version=${{ github.event.inputs.operator-version }} --field replaces=${{ github.event.inputs.replaces }} --field mcad-version=${{ github.event.inputs.mcad-version }} --field codeflare-sdk-version=${{ github.event.inputs.codeflare-sdk-version }} --field instascale-version=${{ github.event.inputs.instascale-version }} --field kuberay-version=${{ github.event.inputs.kuberay-version }} --field quay-organization=${{ github.event.inputs.quay-organization }} --field community-operators-prod-fork-organization=${{ github.event.inputs.codeflare-repository-organization }} --field community-operators-prod-organization=${{ github.event.inputs.community-operators-prod-organization }} + gh workflow run tag-and-build.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/codeflare-operator --ref ${{ github.ref }} --field is-stable=${{ github.event.inputs.is-stable }} --field version=${{ github.event.inputs.operator-version }} --field replaces=${{ github.event.inputs.replaces }} --field codeflare-sdk-version=${{ github.event.inputs.codeflare-sdk-version }} --field kuberay-version=${{ github.event.inputs.kuberay-version }} --field quay-organization=${{ github.event.inputs.quay-organization }} --field community-operators-prod-fork-organization=${{ github.event.inputs.codeflare-repository-organization }} --field community-operators-prod-organization=${{ github.event.inputs.community-operators-prod-organization }} env: GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} shell: bash diff --git a/.github/workflows/tag-and-build.yml b/.github/workflows/tag-and-build.yml index 9dc290c4..870ac35c 100644 --- a/.github/workflows/tag-and-build.yml +++ b/.github/workflows/tag-and-build.yml @@ -12,18 +12,10 @@ on: description: 'The previous semantic version that this tag replaces.' required: true default: 'v0.0.0-dev' - mcad-version: - description: 'Published version of multi-cluster-app-dispatcher' - required: true - default: 'v0.0.0-dev' codeflare-sdk-version: description: 'Published version of CodeFlare-SDK' required: true default: 'v0.0.0-dev' - instascale-version: - description: 'Published version of InstaScale' - required: true - default: 'v0.0.0-dev' kuberay-version: description: 'Tested version of KubeRay' required: true @@ -90,18 +82,9 @@ jobs: - name: Adjust Compatibility Matrix in readme run: | sed -i -E "s|(.*CodeFlare Operator.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.version }}\2${{ github.event.inputs.version }}\3|" README.md - sed -i -E "s|(.*Multi-Cluster App Dispatcher.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.mcad-version }}\2${{ github.event.inputs.mcad-version }}\3|" README.md sed -i -E "s|(.*CodeFlare-SDK.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.codeflare-sdk-version }}\2${{ github.event.inputs.codeflare-sdk-version }}\3|" README.md - sed -i -E "s|(.*InstaScale.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.instascale-version }}\2${{ github.event.inputs.instascale-version }}\3|" README.md sed -i -E "s|(.*KubeRay.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.kuberay-version }}\2${{ github.event.inputs.kuberay-version }}\3|" README.md - - name: Adjust MCAD, SDK and InstaScale dependencies in the code - run: | - sed -i -E "s/(.*MCAD_VERSION \?= ).*/\1${{ github.event.inputs.mcad-version }}/" Makefile - sed -i -E "s/(.*MCAD_REF \?= ).*/\1release-\${MCAD_VERSION}/" Makefile - sed -i -E "s/(.*INSTASCALE_VERSION \?= ).*/\1${{ github.event.inputs.instascale-version }}/" Makefile - sed -i -E "s/(.*KUBERAY_VERSION \?= ).*/\1${{ github.event.inputs.kuberay-version }}/" Makefile - - name: Update image version in params.env run: | VERSION=${{ github.event.inputs.version }} perl -i -pe 's/:(.*)$/:$ENV{"VERSION"}/' config/manager/params.env @@ -192,8 +175,6 @@ jobs: env: VERSION: ${{ github.event.inputs.version }} PREVIOUS_VERSION: ${{ github.event.inputs.replaces }} - INSTASCALE_VERSION: ${{ github.event.inputs.instascale-version }} - MCAD_VERSION: ${{ github.event.inputs.mcad-version }} GH_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} OPERATORS_REPO_FORK_ORG: ${{ github.event.inputs.community-operators-prod-fork-organization }} OPERATORS_REPO_ORG: ${{ github.event.inputs.community-operators-prod-organization }}