Release - Orchestrate Overall Release Phases #332
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
# This Workflow performs a full release of Che | |
name: Release - Orchestrate Overall Release Phases | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'The version that is going to be released. Should be in format 7.y.z' | |
required: true | |
default: '' | |
releaseParent: | |
description: 'If true, will also release Che Parent.' | |
required: false | |
default: 'false' | |
versionParent: | |
description: 'The version of Che Parent' | |
required: false | |
default: '7.15.0' | |
phases: | |
description: ' | |
# Comma-separated phases to perform. | |
#1: Code, MachineExec, Dashboard, Server, branches; | |
#2: E2E, PluginRegistry; | |
#3: DevfileRegistry; | |
#4: CheOperator; | |
# Default: 1,2,3,4 | |
# Omit phases that have successfully run. | |
' | |
required: true | |
default: '1,2,3,4' | |
jobs: | |
pre_job: | |
runs-on: ubuntu-22.04 | |
# Map a step output to a job output | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
# always skip concurrent runs | |
concurrent_skipping: 'always' | |
# prevent re-running the same release for the same version and phases | |
skip_after_successful_duplicate: 'false' | |
# "workflow_dispatch" trigger is set for exclusion by default, so we have to clear it | |
do_not_skip: '[]' | |
build: | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Login to docker.io | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
registry: docker.io | |
- name: Login to quay.io | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
registry: quay.io | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.9 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
java-package: jdk | |
architecture: x64 | |
distribution: adopt | |
- name: Set up environment | |
run: | | |
python -m pip install --upgrade pip | |
pip install yq | |
python --version | |
pip --version | |
yq --version | |
# install more repos | |
sudo apt-get update -y || true | |
# install more dependencies | |
sudo apt-get -y -q install wget curl bash git hub | |
java -version | |
# want git >=2.24, hub >=2 | |
hub --version # hub reports git version too | |
# want >=5 | |
bash --version | |
# do we need any of these? | |
# docker-ce x86_64 3:19.03.14-3.el7 docker-ce-stable 24 M | |
# gcc-c++ x86_64 4.8.5-44.el7 base 7.2 M | |
# nodejs x86_64 2:10.23.0-1nodesource nodesource 20 M | |
# yarn noarch 1.22.5-1 yarn 1.2 M | |
- name: Release | |
run: | | |
CHE_VERSION="${{ github.event.inputs.version }}" | |
echo "CHE_VERSION=${CHE_VERSION}" | |
PHASES="${{ github.event.inputs.phases }}" | |
PARENT_VERSION="${{ github.event.inputs.versionParent }}" | |
PARENT_RELEASE="${{ github.event.inputs.releaseParent }}" | |
export CHE_GITHUB_SSH_KEY=${{ secrets.CHE_GITHUB_SSH_KEY }} | |
export QUAY_ECLIPSE_CHE_USERNAME=${{ secrets.QUAY_USERNAME }} | |
export QUAY_ECLIPSE_CHE_PASSWORD=${{ secrets.QUAY_PASSWORD }} | |
git config --global user.name "Mykhailo Kuznietsov" | |
git config --global user.email "mkuznets@redhat.com" | |
export GITHUB_TOKEN=${{ secrets.CHE_BOT_GITHUB_TOKEN }} | |
export CHE_BOT_GITHUB_TOKEN=${{ secrets.CHE_BOT_GITHUB_TOKEN }} | |
export CHE_INCUBATOR_BOT_GITHUB_TOKEN=${{ secrets.CHE_INCUBATOR_BOT_GITHUB_TOKEN }} | |
set -e | |
./make-release.sh -v ${CHE_VERSION} -p ${PHASES} --parent-version ${PARENT_VERSION} | |
#- name: Create failure MM message | |
#if: ${{ failure() }} | |
#run: | | |
#echo "{\"text\":\":no_entry_sign: Che Release Orchestrator ${{ github.event.inputs.version }} has failed: https://github.com/eclipse-che/che-release/actions/workflows/release-orchestrate-overall.yml\"}" > mattermost.json | |
#- name: Send MM message | |
#if: ${{ 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 |