-
Notifications
You must be signed in to change notification settings - Fork 71
162 lines (154 loc) · 6.23 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#
# Copyright (c) 2020-2023 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'
required: false
default: '7.15.0'
forceRecreateTags:
description: 'If true, tags will be overriden and regenerated. Use with caution.'
required: false
default: 'false'
rebuildFromExistingTags:
description: 'If true, and *forceRecreateTags* is false, a checkout to existing tags will be performed.'
required: false
default: 'false'
buildAndPushImages:
description: 'If true, Che Server images will be build.'
required: false
default: 'true'
bumpNextVersion:
description: 'If true, will update this project to the next version.'
required: false
default: 'true'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
path: che-server
fetch-depth: 0
- uses: actions/checkout@v3
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: Set up QEMU
uses: docker/setup-qemu-action@v3
- 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@v4
with:
python-version: 3.9
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- 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
git --version
gh --version
# want >=5
bash --version
java -version
which java
javac -version
which javac
- name: Release
run: |
export CHE_VERSION="${{ github.event.inputs.version }}"
echo "CHE_VERSION=${CHE_VERSION}"
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 REBUILD_FROM_EXISTING_TAGS="${{ github.event.inputs.rebuildFromExistingTags }}"
export BUILD_AND_PUSH_IMAGES="${{ github.event.inputs.buildAndPushImages }}"
export BUMP_NEXT_VERSION="${{ github.event.inputs.bumpNextVersion }}"
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 "[email protected]"
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
./che-server/make-release.sh
- name: Create GH Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.CHE_BOT_GITHUB_TOKEN }}
with:
allowUpdates: true
body: Eclipse Che ${{ github.event.inputs.version }}
draft: false
name: Eclipse Che ${{ github.event.inputs.version }}
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: false
tag: ${{ github.event.inputs.version }}
token: ${{ secrets.CHE_BOT_GITHUB_TOKEN }}
#- name: Create failure MM message
#if: ${{ failure() }}
#run: |
#echo "{\"text\":\":no_entry_sign: Che Server ${{ github.event.inputs.version }} release has failed: https://github.com/eclipse-che/che-server/actions/workflows/release.yml\"}" > mattermost.json
#- name: Create success MM message
#run: |
#echo "{\"text\":\":white_check_mark: Che Server ${{ github.event.inputs.version }} has been released: https://quay.io/eclipse/che-server:${{ github.event.inputs.version }}\"}" > mattermost.json
#- name: Send MM message
#if: ${{ success() }} || ${{ failure() }}
#uses: mattermost/[email protected]
#env:
#MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
#MATTERMOST_CHANNEL: eclipse-che-releases
#MATTERMOST_USERNAME: che-bot