80 lines
3.4 KiB
YAML
80 lines
3.4 KiB
YAML
#
|
|
# 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
|
|
#
|
|
|
|
# This Workflow creates PRs for the release of the latest che-operator to the community operators in OperatorHub
|
|
name: Release community operator PRs
|
|
on:
|
|
# manual trigger if required
|
|
workflow_dispatch:
|
|
inputs:
|
|
forceflag:
|
|
description: 'To update an existing PR, use -f or --force flag here'
|
|
default: ''
|
|
# trigger on commit to master branch of new CSVs, eg., https://github.com/eclipse/che-operator/pull/571/files
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'version/version.go'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up environment
|
|
run: |
|
|
sudo apt-get update -y || true
|
|
sudo apt-get -y -q install curl bash git
|
|
- name: Set up Python 3.9
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.9
|
|
- name: Install operator courier, yq
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install yq
|
|
- name: Release community operator PR
|
|
run: |
|
|
git config --global user.name "Mykhailo Kuznietsov"
|
|
git config --global user.email "mkuznets@redhat.com"
|
|
export GITHUB_TOKEN=${{ secrets.CHE_INCUBATOR_BOT_GITHUB_TOKEN }}
|
|
set -e
|
|
OP_SDK_DIR=/opt/operator-sdk
|
|
mkdir -p $OP_SDK_DIR
|
|
make download-operator-sdk DEST="${OP_SDK_DIR}"
|
|
export PATH="$PATH:$OP_SDK_DIR"
|
|
export QUAY_ECLIPSE_CHE_USERNAME=${{ secrets.QUAY_USERNAME }}
|
|
export QUAY_ECLIPSE_CHE_PASSWORD=${{ secrets.QUAY_PASSWORD }}
|
|
|
|
export QUAY_USERNAME_K8S=${{ secrets.QUAY_ECLIPSE_CHE_OPERATOR_KUBERNETES_USERNAME }}
|
|
export QUAY_PASSWORD_K8S=${{ secrets.QUAY_ECLIPSE_CHE_OPERATOR_KUBERNETES_PASSWORD }}
|
|
export QUAY_USERNAME_OS=${{ secrets.QUAY_ECLIPSE_CHE_OPERATOR_OPENSHIFT_USERNAME }}
|
|
export QUAY_PASSWORD_OS=${{ secrets.QUAY_ECLIPSE_CHE_OPERATOR_OPENSHIFT_PASSWORD }}
|
|
build/scripts/release/make-release.sh --prepare-community-operators-update ${{ github.event.inputs.forceflag }}
|
|
# - name: Create failure MM message
|
|
# if: ${{ failure() }}
|
|
# run: |
|
|
# echo "{\"text\":\":no_entry_sign: Che Community Operator ${{ github.event.inputs.version }} release has failed: https://github.com/eclipse-che/che-operator/actions/workflows/release-community-operator-PRs.yml\"}" > mattermost.json
|
|
# - name: Create success MM message
|
|
# run: |
|
|
# echo "{\"text\":\":white_check_mark: Che Community Operator ${{ github.event.inputs.version }} release PR has been created: https://github.com/redhat-openshift-ecosystem/community-operators-prod/pulls?q=is%3Apr+is%3Aopen+eclipse-che\"}" > mattermost.json
|
|
# - name: Send MM message
|
|
# if: ${{ success() }} || ${{ failure() }}
|
|
# uses: mattermost/action-mattermost-notify@1.1.0
|
|
# env:
|
|
# MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
|
|
# MATTERMOST_CHANNEL: eclipse-che-releases
|
|
# MATTERMOST_USERNAME: che-bot
|