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