Skip to content

Commit

Permalink
Add release workflow for che parent and server (#18909)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuznyetsov authored Feb 3, 2021
1 parent ef05a7c commit 18f3b63
Show file tree
Hide file tree
Showing 2 changed files with 526 additions and 161 deletions.
127 changes: 127 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#
# Copyright (c) 2020 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
#

name: Release Che Server

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: 'Specify Che Parent version here, if *releaseParent is true'
required: false
default: ''
forceRecreateTags:
description: 'If true, tags will be overriden and regenerated. Use with caution.'
required: false
default: 'false'
autoReleaseOnNexus:
description: 'If true, artifacts will be automatically released when deployed to Nexus, but only if *deployOnNexus* is also true.'
required: false
default: 'true'
deployOnNexus:
description: 'If true, artifacts will be deployed to Nexus.'
required: false
default: 'true'

jobs:
build:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
with:
path: che
fetch-depth: 0
- uses: actions/checkout@v2
if: ${{ github.event.inputs.releaseParent == 'true' }}
with:
repository: eclipse/che-parent
token: {{ secrets.CHE_BOT_GITHUB_TOKEN }}
path: che-parent
fetch-depth: 0
- name: Check existing tag
run: |
if [[ "$FORCE_RECREATE_TAGS" == "false" ]] && [[ $(cd che && git ls-remote --exit-code origin refs/tags/${{ github.event.inputs.version}} ]]; then
echo "cannot create release, when tag already exists"
exit 1
fi
- name: Login to docker.io
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
registry: docker.io
- name: Login to quay.io
uses: docker/login-action@v1
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
registry: quay.io
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- uses: actions/setup-java@v1
with:
java-version: '11.0.7'
java-package: jdk
architecture: x64
- name: Set up environment
run: |
sudo apt-get update -y || true
# install more dependencies
sudo apt-get -y -q install wget curl bash git
java -version
# want git >=2.24, hub >=2
hub --version # hub reports git version too
# want >=5
bash --version
java -version
which java
javac -version
which javac
- name: Release
run: |
CHE_VERSION="${{ github.event.inputs.version }}"
echo "CHE_VERSION=${CHE_VERSION}"
PHASES="${{ github.event.inputs.phases }}"
echo "PHASES=${PHASES}"
sed -i VERSION -r -e "s#PHASES=.*#PHASES=${PHASES}#"
export CHE_MAVEN_SETTINGS=${{ secrets.CHE_MAVEN_SETTINGS}}
export CHE_OSS_SONATYPE_GPG_KEY=${{ secrets.CHE_OSS_SONATYPE_GPG_KEY}}
export CHE_OSS_SONATYPE_PASSPHRASE=${{ secrets.CHE_OSS_SONATYPE_PASSPHRASE}}
export CHE_GITHUB_SSH_KEY=${{ secrets.CHE_GITHUB_SSH_KEY}}
export CHE_NPM_AUTH_TOKEN=${{ secrets.CHE_NPM_AUTH_TOKEN}}
export RELEASE_CHE_PARENT="${{ github.event.inputs.releaseParent }}"
export VERSION_CHE_PARENT="${{ github.event.inputs.versionParent }}"
export DEPLOY_TO_NEXUS="${{ github.event.inputs.deployOnNexus }}"
export AUTORELEASE_ON_NEXUS="${{ github.event.inputs.autoReleaseOnNexus }}"
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 }}
set -e
# determine which OS we're using: rhel or ubuntu
cat /etc/os-release || true
./make-release.sh
Loading

0 comments on commit 18f3b63

Please sign in to comment.