From 9eee2bfc6f7791e85675bc95d76d556025132cb5 Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Fri, 11 Dec 2020 02:31:27 -0500 Subject: [PATCH] new GH action to generate community operator PRs (#572) * new GH action to generate community PRs; seems default ubuntu runner already has hub installed, so don't need to explicitly install it Change-Id: I928ff2c9e3d3010926077841af43ecac40ce3f07 Signed-off-by: nickboldt * switch trigger to be when master branch PR is merged Change-Id: I5e36b092f5e702ad36bac783d41b717cd0de6b44 Signed-off-by: nickboldt --- .../release-community-operator-PRs.yml | 42 +++++++++++++++++++ .github/workflows/release.yml | 5 ++- 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release-community-operator-PRs.yml diff --git a/.github/workflows/release-community-operator-PRs.yml b/.github/workflows/release-community-operator-PRs.yml new file mode 100644 index 000000000..28ea53e6f --- /dev/null +++ b/.github/workflows/release-community-operator-PRs.yml @@ -0,0 +1,42 @@ +# This Workflow creates PRs for the release of the latest che-operator to the community operators in OperatorHub +name: Release community operator PRs +on: + # 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: + - master + paths: + - 'olm/eclipse-che-preview-*/deploy/olm-catalog/eclipse-che-preview-*/eclipse-che-preview-*.package.yaml' + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: 3.6 + - name: Install yq + run: | + python -m pip install --upgrade pip + pip install yq + # - name: Install homebrew and hub + # run: | + # /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"; brew install hub + - name: Release community operator PRs + run: | + hub version + git config --global user.name "Mykhailo Kuznietsov" + git config --global user.email "mkuznets@redhat.com" + export GITHUB_TOKEN=${{ secrets.CHE_BOT_GITHUB_TOKEN }} + ./olm/prepare-community-operators-update.sh ${{ github.event.inputs.forceflag }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9418416f..4dea26cc3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - with: + with: fetch-depth: 0 - name: Set up Python 3.6 uses: actions/setup-python@v2 @@ -36,6 +36,7 @@ jobs: echo "CHE_VERSION=${CHE_VERSION}" BRANCH=${CHE_VERSION%.*}.x echo "BRANCH=${BRANCH}" + hub version git config --global user.name "Mykhailo Kuznietsov" git config --global user.email "mkuznets@redhat.com" export GITHUB_TOKEN=${{ secrets.CHE_BOT_GITHUB_TOKEN }} @@ -80,4 +81,4 @@ jobs: # perform extra checkouts to ensure branches exist locally git checkout ${BRANCH} git checkout ${CHE_VERSION}-release - ./make-release.sh ${CHE_VERSION} --push-git-changes --pull-requests + ./make-release.sh ${CHE_VERSION} --push-git-changes --pull-requests