|
22 | 22 | branches: |
23 | 23 | - main |
24 | 24 | jobs: |
25 | | - build-operator-image: |
26 | | - runs-on: ubuntu-22.04 |
| 25 | + build-operator-image-multiarch: |
| 26 | + strategy: |
| 27 | + fail-fast: false |
| 28 | + matrix: |
| 29 | + runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] |
| 30 | + runs-on: ${{matrix.runners}} |
27 | 31 | steps: |
28 | 32 | - name: Checkout source code |
29 | 33 | uses: actions/checkout@v3 |
30 | | - - name: Install yq |
31 | | - run: sudo pip install yq |
32 | | - - name: Set up QEMU |
33 | | - uses: docker/setup-qemu-action@v3 |
34 | | - - name: Set up Docker Buildx |
35 | | - uses: docker/setup-buildx-action@v3 |
| 34 | + - name: Set arch environment variable |
| 35 | + run: | |
| 36 | + if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then |
| 37 | + echo arch="amd64" >> $GITHUB_ENV |
| 38 | + else |
| 39 | + echo arch="arm64" >> $GITHUB_ENV |
| 40 | + fi |
| 41 | + - name: Set short_sha environment variable |
| 42 | + run: echo short_sha="$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV |
36 | 43 | - name: Login to quay.io |
37 | 44 | uses: docker/login-action@v2 |
38 | 45 | with: |
39 | 46 | username: ${{ secrets.QUAY_USERNAME }} |
40 | 47 | password: ${{ secrets.QUAY_PASSWORD }} |
41 | 48 | registry: quay.io |
42 | 49 | - name: Build operator image |
43 | | - uses: docker/build-push-action@v3 |
| 50 | + run: | |
| 51 | + docker buildx build \ |
| 52 | + --platform linux/${{env.arch}} \ |
| 53 | + --progress=plain \ |
| 54 | + --push \ |
| 55 | + -t quay.io/eclipse/che-operator:${{env.arch}}-${{short_sha}} . |
| 56 | +
|
| 57 | + publish-operator-manifest: |
| 58 | + name: publish operator image |
| 59 | + runs-on: ubuntu-22.04 |
| 60 | + needs: build-operator-image-multiarch |
| 61 | + steps: |
| 62 | + - name: Login to Quay.io |
| 63 | + uses: docker/login-action@v2 |
44 | 64 | with: |
45 | | - file: Dockerfile |
46 | | - platforms: linux/amd64,linux/ppc64le,linux/arm64 |
47 | | - push: true |
48 | | - tags: quay.io/eclipse/che-operator:next |
| 65 | + registry: quay.io |
| 66 | + username: ${{ secrets.QUAY_USERNAME }} |
| 67 | + password: ${{ secrets.QUAY_PASSWORD }} |
| 68 | + - name: Set short_sha environment variable |
| 69 | + run: echo short_sha="$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV |
| 70 | + - name: publish |
| 71 | + run: | |
| 72 | + docker manifest create quay.io/eclipse/che-operator:next \ |
| 73 | + --amend quay.io/eclipse/che-operator:amd64-${{env.short_sha}} \ |
| 74 | + --amend quay.io/eclipse/che-operator:arm64-${{env.short_sha}} |
| 75 | + docker manifest annotate quay.io/eclipse/che-operator:next \ |
| 76 | + quay.io/eclipse/che-operator:amd64-${{env.short_sha}} \ |
| 77 | + --os linux --arch amd64 |
| 78 | + docker manifest annotate quay.io/eclipse/che-operator:next \ |
| 79 | + quay.io/eclipse/che-operator:arm64-${{env.short_sha}} \ |
| 80 | + --os linux --arch arm64 |
| 81 | + docker manifest push quay.io/eclipse/che-operator:next |
| 82 | +
|
49 | 83 | build-catalog: |
50 | 84 | runs-on: ubuntu-22.04 |
51 | | - needs: build-operator-image |
| 85 | + needs: publish-operator-manifest |
52 | 86 | steps: |
53 | 87 | - name: Checkout source code |
54 | 88 | uses: actions/checkout@v3 |
|
69 | 103 | ${GITHUB_WORKSPACE}/build/scripts/olm/release-catalog.sh \ |
70 | 104 | --channel next \ |
71 | 105 | --image-tool docker \ |
72 | | - --platform linux/amd64,linux/arm64,linux/ppc64le \ |
| 106 | + --platform linux/amd64,linux/arm64 \ |
73 | 107 | --catalog-image quay.io/eclipse/eclipse-che-olm-catalog:next |
| 108 | +
|
74 | 109 | build-catalog-with-digest: |
75 | 110 | runs-on: ubuntu-22.04 |
76 | 111 | needs: build-operator-image |
@@ -101,6 +136,6 @@ jobs: |
101 | 136 | ${GITHUB_WORKSPACE}/build/scripts/olm/release-catalog.sh \ |
102 | 137 | --channel next \ |
103 | 138 | --image-tool docker \ |
104 | | - --platform linux/amd64,linux/arm64,linux/ppc64le \ |
| 139 | + --platform linux/amd64,linux/arm64 \ |
105 | 140 | --catalog-image quay.io/eclipse/eclipse-che-olm-catalog:next-digest \ |
106 | 141 | --bundle-image quay.io/eclipse/eclipse-che-olm-bundle:$(make bundle-version CHANNEL=next)-digest |
0 commit comments