|
| 1 | +# This workflow will build and release all components of the CodeFlare project |
| 2 | + |
| 3 | +name: Project CodeFlare Release |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + operator-version: |
| 8 | + description: 'CodeFlare operator version to be released (for example: v0.0.0)' |
| 9 | + required: true |
| 10 | + replaces: |
| 11 | + description: 'The previous operator semantic version that this release replaces (for example: v0.0.0)' |
| 12 | + required: true |
| 13 | + mcad-version: |
| 14 | + description: 'Version of multi-cluster-app-dispatcher to be released (for example: v0.0.0)' |
| 15 | + required: true |
| 16 | + codeflare-sdk-version: |
| 17 | + description: 'Version of CodeFlare-SDK to be released (for example: v0.0.0)' |
| 18 | + required: true |
| 19 | + instascale-version: |
| 20 | + description: 'Version of InstaScale to be released (for example: v0.0.0)' |
| 21 | + required: true |
| 22 | + is-stable: |
| 23 | + description: 'Select if the built images should be tagged as stable' |
| 24 | + required: true |
| 25 | + type: boolean |
| 26 | + codeflare-repository-organization: |
| 27 | + description: 'GitHub organization/user containing repositories used for release' |
| 28 | + required: true |
| 29 | + default: 'project-codeflare' |
| 30 | + quay-organization: |
| 31 | + description: 'Quay organization used to push the built images to' |
| 32 | + required: true |
| 33 | + default: 'project-codeflare' |
| 34 | + community-operators-prod-organization: |
| 35 | + description: 'Owner of target community-operators-prod repository used to open a PR against' |
| 36 | + required: true |
| 37 | + default: 'redhat-openshift-ecosystem' |
| 38 | + |
| 39 | +jobs: |
| 40 | + release-mcad: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + |
| 43 | + steps: |
| 44 | + - name: Release MCAD |
| 45 | + run: | |
| 46 | + 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 | + env: |
| 48 | + GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} |
| 49 | + shell: bash |
| 50 | + |
| 51 | + - name: Wait for MCAD run to finish |
| 52 | + run: | |
| 53 | + # wait for a while for Run to be started |
| 54 | + sleep 5 |
| 55 | + 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) |
| 56 | + gh run watch ${run_id} --repo ${{ github.event.inputs.codeflare-repository-organization }}/multi-cluster-app-dispatcher --interval 10 --exit-status |
| 57 | + env: |
| 58 | + GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} |
| 59 | + shell: bash |
| 60 | + |
| 61 | + release-instascale: |
| 62 | + needs: release-mcad |
| 63 | + runs-on: ubuntu-latest |
| 64 | + |
| 65 | + steps: |
| 66 | + - name: Release InstaScale |
| 67 | + run: | |
| 68 | + 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 | + env: |
| 70 | + GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} |
| 71 | + shell: bash |
| 72 | + |
| 73 | + - name: Wait for InstaScale run to finish |
| 74 | + run: | |
| 75 | + # wait for a while for Run to be started |
| 76 | + sleep 5 |
| 77 | + run_id=$(gh run list --workflow instascale-release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/instascale --limit 1 --json databaseId --jq .[].databaseId) |
| 78 | + gh run watch ${run_id} --repo ${{ github.event.inputs.codeflare-repository-organization }}/instascale --interval 10 --exit-status |
| 79 | + env: |
| 80 | + GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} |
| 81 | + shell: bash |
| 82 | + |
| 83 | + release-codeflare-sdk: |
| 84 | + runs-on: ubuntu-latest |
| 85 | + |
| 86 | + steps: |
| 87 | + - name: Release CodeFlare SDK |
| 88 | + run: | |
| 89 | + semver_version="${{ github.event.inputs.codeflare-sdk-version }}" |
| 90 | + plain_version="${semver_version:1}" |
| 91 | + gh workflow run release.yaml --repo ${{ github.event.inputs.codeflare-repository-organization }}/codeflare-sdk --ref ${{ github.ref }} --field release-version=${plain_version} --field is-latest=${{ github.event.inputs.is-stable }} --field quay-organization=${{ github.event.inputs.quay-organization }} |
| 92 | + env: |
| 93 | + GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} |
| 94 | + shell: bash |
| 95 | + |
| 96 | + - name: Wait for CodeFlare SDK run to finish |
| 97 | + run: | |
| 98 | + # wait for a while for Run to be started |
| 99 | + sleep 5 |
| 100 | + run_id=$(gh run list --workflow release.yaml --repo ${{ github.event.inputs.codeflare-repository-organization }}/codeflare-sdk --limit 1 --json databaseId --jq .[].databaseId) |
| 101 | + gh run watch ${run_id} --repo ${{ github.event.inputs.codeflare-repository-organization }}/codeflare-sdk --interval 10 --exit-status |
| 102 | + env: |
| 103 | + GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} |
| 104 | + shell: bash |
| 105 | + |
| 106 | + release-codeflare-operator: |
| 107 | + needs: [release-mcad, release-instascale, release-codeflare-sdk] |
| 108 | + runs-on: ubuntu-latest |
| 109 | + |
| 110 | + steps: |
| 111 | + - name: Release CodeFlare operator |
| 112 | + run: | |
| 113 | + 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 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 }} |
| 114 | + env: |
| 115 | + GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} |
| 116 | + shell: bash |
| 117 | + |
| 118 | + - name: Wait for CodeFlare operator run to finish |
| 119 | + run: | |
| 120 | + # wait for a while for Run to be started |
| 121 | + sleep 5 |
| 122 | + run_id=$(gh run list --workflow tag-and-build.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/codeflare-operator --limit 1 --json databaseId --jq .[].databaseId) |
| 123 | + gh run watch ${run_id} --repo ${{ github.event.inputs.codeflare-repository-organization }}/codeflare-operator --interval 10 --exit-status |
| 124 | + env: |
| 125 | + GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} |
| 126 | + shell: bash |
0 commit comments