|
| 1 | +name: ImageRelease |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: {} |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - "v*.*.*" |
| 8 | + |
| 9 | +env: |
| 10 | + GO_VERSION: "1.24" |
| 11 | + GITHUB_REF: ${{ github.ref }} |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
| 16 | +jobs: |
| 17 | + env: |
| 18 | + name: prepare release env |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + fetch-depth: 1 |
| 25 | + - name: Get release version |
| 26 | + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV" |
| 27 | + outputs: |
| 28 | + RELEASE_VERSION: ${{ env.RELEASE_VERSION }} |
| 29 | + |
| 30 | + images: |
| 31 | + name: images |
| 32 | + runs-on: ubuntu-latest |
| 33 | + needs: [env] |
| 34 | + strategy: |
| 35 | + matrix: |
| 36 | + arch: [amd64, arm64] |
| 37 | + image: [controller, addon] |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@v4 |
| 41 | + with: |
| 42 | + fetch-depth: 1 |
| 43 | + - name: Install Go |
| 44 | + uses: actions/setup-go@v5 |
| 45 | + with: |
| 46 | + go-version: ${{ env.GO_VERSION }} |
| 47 | + cache: true |
| 48 | + - name: Log in to Quay |
| 49 | + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login quay.io --username "${{ secrets.DOCKER_USER }}" --password-stdin |
| 50 | + - name: Build and push controller image |
| 51 | + if: matrix.image == 'controller' |
| 52 | + env: |
| 53 | + IMAGE_BUILD_EXTRA_FLAGS: --build-arg OS=linux --build-arg ARCH=${{ matrix.arch }} |
| 54 | + CONTROLLER_IMAGE_TAG: ${{ needs.env.outputs.RELEASE_VERSION }}-${{ matrix.arch }} |
| 55 | + run: | |
| 56 | + make docker-build-controller |
| 57 | + make docker-push-controller |
| 58 | + - name: Build and push addon image |
| 59 | + if: matrix.image == 'addon' |
| 60 | + env: |
| 61 | + IMAGE_BUILD_EXTRA_FLAGS: --build-arg OS=linux --build-arg ARCH=${{ matrix.arch }} |
| 62 | + ADDON_IMAGE_TAG: ${{ needs.env.outputs.RELEASE_VERSION }}-${{ matrix.arch }} |
| 63 | + run: | |
| 64 | + make docker-build-addon |
| 65 | + make docker-push-addon |
| 66 | +
|
| 67 | + image-manifest: |
| 68 | + name: image manifest |
| 69 | + runs-on: ubuntu-latest |
| 70 | + needs: [env, images] |
| 71 | + strategy: |
| 72 | + matrix: |
| 73 | + image: [controller, addon] |
| 74 | + steps: |
| 75 | + - name: Checkout |
| 76 | + uses: actions/checkout@v4 |
| 77 | + with: |
| 78 | + fetch-depth: 1 |
| 79 | + - name: Log in to Quay |
| 80 | + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login quay.io --username "${{ secrets.DOCKER_USER }}" --password-stdin |
| 81 | + - name: Create and push controller manifest |
| 82 | + if: matrix.image == 'controller' |
| 83 | + env: |
| 84 | + CONTROLLER_IMAGE_TAG: ${{ needs.env.outputs.RELEASE_VERSION }} |
| 85 | + run: make image-manifest-controller |
| 86 | + - name: Create and push addon manifest |
| 87 | + if: matrix.image == 'addon' |
| 88 | + env: |
| 89 | + ADDON_IMAGE_TAG: ${{ needs.env.outputs.RELEASE_VERSION }} |
| 90 | + run: make image-manifest-addon |
0 commit comments