|
| 1 | +name: release-for-ec |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + tag: |
| 7 | + description: 'Tag to use for building images and tagging Helm chart (must end with -ec.<digit>, e.g. v1.92.0-ec.1)' |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: write |
| 13 | + |
| 14 | +jobs: |
| 15 | + validate-tag: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Validate tag format |
| 19 | + run: | |
| 20 | + if ! [[ "${{ inputs.tag }}" =~ -ec\.[0-9]+$ ]]; then |
| 21 | + echo "Error: Tag must end with -ec.<digit> suffix (e.g. v1.92.0-ec.1)" |
| 22 | + exit 1 |
| 23 | + fi |
| 24 | + echo "Tag format is valid: ${{ inputs.tag }}" |
| 25 | +
|
| 26 | + build-migrations-melange-packages: |
| 27 | + needs: [validate-tag] |
| 28 | + strategy: |
| 29 | + fail-fast: true |
| 30 | + matrix: |
| 31 | + runner: [ |
| 32 | + {name: ubuntu-latest, arch: amd64}, |
| 33 | + {name: arm64-runner-set, arch: arm64} |
| 34 | + ] |
| 35 | + runs-on: ${{ matrix.runner.name }} |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + - uses: ./.github/actions/build-custom-melange-package |
| 39 | + with: |
| 40 | + context: migrations/deploy |
| 41 | + component: kotsadm-migrations |
| 42 | + git-tag: ${{ inputs.tag }} |
| 43 | + arch: ${{ matrix.runner.arch }} |
| 44 | + |
| 45 | + build-migrations: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + needs: [build-migrations-melange-packages] |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v4 |
| 50 | + - uses: ./.github/actions/build-custom-image-with-apko |
| 51 | + with: |
| 52 | + context: migrations/deploy |
| 53 | + component: kotsadm-migrations |
| 54 | + git-tag: ${{ inputs.tag }} |
| 55 | + image-name: index.docker.io/kotsadm/kotsadm-migrations:${{ inputs.tag }} |
| 56 | + registry-username: ${{ secrets.DOCKERHUB_USER }} |
| 57 | + registry-password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 58 | + |
| 59 | + build-kurl-proxy-melange-packages: |
| 60 | + needs: [validate-tag] |
| 61 | + strategy: |
| 62 | + fail-fast: true |
| 63 | + matrix: |
| 64 | + runner: [ |
| 65 | + {name: ubuntu-latest, arch: amd64}, |
| 66 | + {name: arm64-runner-set, arch: arm64} |
| 67 | + ] |
| 68 | + runs-on: ${{ matrix.runner.name }} |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + - uses: ./.github/actions/build-custom-melange-package |
| 72 | + with: |
| 73 | + context: kurl_proxy/deploy |
| 74 | + component: kurl-proxy |
| 75 | + git-tag: ${{ inputs.tag }} |
| 76 | + arch: ${{ matrix.runner.arch }} |
| 77 | + |
| 78 | + build-kurl-proxy: |
| 79 | + runs-on: ubuntu-latest |
| 80 | + needs: [build-kurl-proxy-melange-packages] |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v4 |
| 83 | + - uses: ./.github/actions/build-custom-image-with-apko |
| 84 | + with: |
| 85 | + context: kurl_proxy/deploy |
| 86 | + component: kurl-proxy |
| 87 | + git-tag: ${{ inputs.tag }} |
| 88 | + image-name: index.docker.io/kotsadm/kurl-proxy:${{ inputs.tag }} |
| 89 | + registry-username: ${{ secrets.DOCKERHUB_USER }} |
| 90 | + registry-password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 91 | + |
| 92 | + build-kotsadm-melange-packages: |
| 93 | + needs: [validate-tag] |
| 94 | + strategy: |
| 95 | + fail-fast: true |
| 96 | + matrix: |
| 97 | + runner: [ |
| 98 | + {name: ubuntu-latest, arch: amd64}, |
| 99 | + {name: arm64-runner-set, arch: arm64} |
| 100 | + ] |
| 101 | + runs-on: ${{ matrix.runner.name }} |
| 102 | + steps: |
| 103 | + - uses: actions/checkout@v4 |
| 104 | + - uses: ./.github/actions/build-custom-melange-package |
| 105 | + with: |
| 106 | + context: deploy |
| 107 | + component: kotsadm |
| 108 | + git-tag: ${{ inputs.tag }} |
| 109 | + arch: ${{ matrix.runner.arch }} |
| 110 | + |
| 111 | + build-kotsadm: |
| 112 | + runs-on: ubuntu-latest |
| 113 | + needs: [build-kotsadm-melange-packages] |
| 114 | + steps: |
| 115 | + - uses: actions/checkout@v4 |
| 116 | + - uses: ./.github/actions/build-custom-image-with-apko |
| 117 | + with: |
| 118 | + context: deploy |
| 119 | + component: kotsadm |
| 120 | + git-tag: ${{ inputs.tag }} |
| 121 | + image-name: index.docker.io/kotsadm/kotsadm:${{ inputs.tag }} |
| 122 | + registry-username: ${{ secrets.DOCKERHUB_USER }} |
| 123 | + registry-password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 124 | + |
| 125 | + tag-helm-chart: |
| 126 | + runs-on: ubuntu-latest |
| 127 | + needs: [build-migrations, build-kurl-proxy, build-kotsadm] |
| 128 | + steps: |
| 129 | + - name: Checkout Chart |
| 130 | + uses: actions/checkout@v4 |
| 131 | + with: |
| 132 | + repository: replicatedhq/kots-helm |
| 133 | + token: ${{ secrets.GH_PAT }} |
| 134 | + ref: main |
| 135 | + |
| 136 | + - name: Tag Chart |
| 137 | + run: | |
| 138 | + git tag "${{ inputs.tag }}+${GITHUB_SHA:0:7}" |
| 139 | + git push origin "${{ inputs.tag }}+${GITHUB_SHA:0:7}" |
0 commit comments