ci: Copy 7.99.0 csv to main (#1974) #282
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright (c) 2019-2023 Red Hat, Inc. | |
# This program and the accompanying materials are made | |
# available under the terms of the Eclipse Public License 2.0 | |
# which is available at https://www.eclipse.org/legal/epl-2.0/ | |
# | |
# SPDX-License-Identifier: EPL-2.0 | |
# | |
# Contributors: | |
# Red Hat, Inc. - initial API and implementation | |
# | |
name: Release next catalog | |
on: | |
# manual trigger if required | |
workflow_dispatch: | |
inputs: | |
reason: | |
description: 'Reason to trigger a build' | |
required: false | |
push: | |
branches: | |
- main | |
jobs: | |
build-operator-image-multiarch: | |
strategy: | |
fail-fast: false | |
matrix: | |
runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] | |
runs-on: ${{matrix.runners}} | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Set arch environment variable | |
run: | | |
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then | |
echo arch="amd64" >> $GITHUB_ENV | |
else | |
echo arch="arm64" >> $GITHUB_ENV | |
fi | |
- name: Set short_sha environment variable | |
run: echo short_sha="$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV | |
- name: Login to quay.io | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
registry: quay.io | |
- name: Build operator image | |
run: | | |
docker buildx build \ | |
--platform linux/${{env.arch}} \ | |
--progress=plain \ | |
--push \ | |
-t quay.io/eclipse/che-operator:${{env.arch}}-${{env.short_sha}} . | |
publish-operator-manifest: | |
name: publish operator image | |
runs-on: ubuntu-22.04 | |
needs: build-operator-image-multiarch | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Login to Quay.io | |
uses: docker/login-action@v2 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Set short_sha environment variable | |
run: echo short_sha="$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV | |
- name: publish | |
run: | | |
docker manifest create quay.io/eclipse/che-operator:next \ | |
--amend quay.io/eclipse/che-operator:amd64-${{env.short_sha}} \ | |
--amend quay.io/eclipse/che-operator:arm64-${{env.short_sha}} | |
docker manifest annotate quay.io/eclipse/che-operator:next \ | |
quay.io/eclipse/che-operator:amd64-${{env.short_sha}} \ | |
--os linux --arch amd64 | |
docker manifest annotate quay.io/eclipse/che-operator:next \ | |
quay.io/eclipse/che-operator:arm64-${{env.short_sha}} \ | |
--os linux --arch arm64 | |
docker manifest push quay.io/eclipse/che-operator:next | |
build-catalog: | |
runs-on: ubuntu-22.04 | |
needs: publish-operator-manifest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Install yq | |
run: sudo pip install yq | |
- name: Login to quay.io | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
registry: quay.io | |
- name: Build catalog source | |
run: | | |
${GITHUB_WORKSPACE}/build/scripts/olm/release-catalog.sh \ | |
--channel next \ | |
--image-tool docker \ | |
--multi-arch \ | |
--catalog-image quay.io/eclipse/eclipse-che-olm-catalog:next | |
build-catalog-with-digest: | |
runs-on: ubuntu-22.04 | |
needs: build-catalog | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Install yq | |
run: sudo pip install yq | |
- name: Login to quay.io | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
registry: quay.io | |
- name: Build catalog source | |
run: | | |
${GITHUB_WORKSPACE}/build/scripts/release/editors-definitions.sh update-manager-yaml \ | |
--yaml-path ${GITHUB_WORKSPACE}/config/manager/manager.yaml | |
${GITHUB_WORKSPACE}/build/scripts/release/samples.sh update-manager-yaml \ | |
--yaml-path ${GITHUB_WORKSPACE}/config/manager/manager.yaml \ | |
--index-json-url "https://raw.githubusercontent.com/eclipse-che/che-dashboard/main/packages/devfile-registry/air-gap/index.json" | |
make update-dev-resources | |
${GITHUB_WORKSPACE}/build/scripts/release/addDigests.sh -s $(make csv-path CHANNEL=next) -t next | |
${GITHUB_WORKSPACE}/build/scripts/olm/release-catalog.sh \ | |
--channel next \ | |
--image-tool docker \ | |
--multi-arch \ | |
--catalog-image quay.io/eclipse/eclipse-che-olm-catalog:next-digest \ | |
--bundle-image quay.io/eclipse/eclipse-che-olm-bundle:$(make bundle-version CHANNEL=next)-digest |