gh18864 new GH action to run che-docs... (#657)

* gh18864 new GH action to run che-docs release when olm/eclipse-che-preview-*/deploy/olm-catalog/eclipse-che-preview-*/eclipse-che-preview-*.package.yaml is updated in master branch

Change-Id: Icfb71b6c1e254af4778dcc4f458c4565e94de867
Signed-off-by: nickboldt <nboldt@redhat.com>

* probably don't need python

Change-Id: I45e689555b9ca2f5722ff18309fd739181578379
Signed-off-by: nickboldt <nboldt@redhat.com>

* forgot the --trigger-release flag to create a tag

Change-Id: Ie41b19f473384eedf131153deb6e32a6288b689b
Signed-off-by: nickboldt <nboldt@redhat.com>
pull/660/head
Nick Boldt 2021-02-03 11:32:30 -05:00 committed by GitHub
parent 84b955398d
commit 6ca3b5b661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 46 additions and 0 deletions

46
.github/workflows/release-che-docs.yml vendored Normal file
View File

@ -0,0 +1,46 @@
# This Workflow creates PRs for the release of the latest che-docs
name: Release che docs
on:
# manual trigger if required
workflow_dispatch:
inputs:
version:
description: 'The version that is going to be released. Should be in format 7.y.z'
required: true
default: '7.y.z'
forceflag:
description: 'To force creation of .x branch, use --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: Release che docs 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 }}
set -e
# if not run manually, need to compute che docs version from latest released CSV
if [[ "${{ github.event.inputs.version }}" == "" ]] || [[ "${{ github.event.inputs.version }}" == "7.y.z" ]]; then
chedocsVersion=$(cat olm/eclipse-che-preview-openshift/deploy/olm-catalog/eclipse-che-preview-openshift/eclipse-che-preview-openshift.package.yaml | yq -r '.channels[].currentCSV' | sed -e "s#eclipse-che-preview-openshift.v##")
else
chedocsVersion="${{ github.event.inputs.version }}"
fi
cd /tmp
# TODO switch to master branch version, not PR version from https://github.com/eclipse/che-docs/pull/1823
curl -sSLO https://raw.githubusercontent.com/eclipse/che-docs/f634c1d49b0bc88718dcb593f75d11f45de2ba1c/make-release.sh
chmod +x make-release.sh
# fetch che-docs code, bump antora playbook file, create .x branch if not exist, and create release tag from that branch
./make-release.sh --repo git@github.com:eclipse/che-docs --version ${chedocsVersion} ${{ github.event.inputs.forceflag }} --trigger-release