Skip to content

Commit 0fd4b3a

Browse files
authored
RATIS-2209. Exercise make_rc.sh in CI (#1244)
1 parent 72c1765 commit 0fd4b3a

File tree

3 files changed

+61
-2
lines changed

3 files changed

+61
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ jobs:
5050
timeout-minutes: 30
5151
secrets: inherit
5252

53+
release:
54+
uses: ./.github/workflows/check.yaml
55+
with:
56+
script: release
57+
timeout-minutes: 30
58+
secrets: inherit
59+
5360
repro:
5461
needs:
5562
- build

dev-support/checks/release.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env bash
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -e -u -o pipefail
18+
19+
# This script tests the local part of the release process. It does not publish anything.
20+
21+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
22+
cd "$DIR/../.." || exit 1
23+
24+
: "${RATISVERSION:="0.0.1"}"
25+
: "${RC:="-ci-test"}"
26+
: "${STAGING_REPO_DIR:="/tmp/ratis.staging-repo"}"
27+
: "${SVNDISTDIR:="/tmp/ratis.svn"}"
28+
: "${USERID:="ratis-ci-not-for-release"}"
29+
30+
MVN_REPO_DIR="${HOME}/.m2/repository"
31+
32+
mkdir -p "${SVNDISTDIR}"
33+
34+
if [[ -z "${CODESIGNINGKEY:-}" ]]; then
35+
gpg --batch --passphrase '' --pinentry-mode loopback --quick-generate-key "${USERID}" rsa4096 default 1d
36+
CODESIGNINGKEY=$(gpg --list-keys --with-colons "${USERID}" | grep '^pub:' | cut -f5 -d:)
37+
fi
38+
39+
git config user.email || git config user.email '[email protected]'
40+
git config user.name || git config user.name 'Test User'
41+
42+
export CODESIGNINGKEY MVN_REPO_DIR RATISVERSION RC SVNDISTDIR
43+
44+
export MAVEN_ARGS="--batch-mode"
45+
46+
dev-support/make_rc.sh 1-prepare-src
47+
dev-support/make_rc.sh 2-verify-bin
48+
dev-support/make_rc.sh 3-publish-mvn -DaltDeploymentRepository="local::default::file://${STAGING_REPO_DIR}"
49+
dev-support/make_rc.sh 4-assembly

dev-support/make_rc.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ mvnFun() {
118118
mv "apache-ratis-${RATISVERSION}-src" "apache-ratis-${RATISVERSION}"
119119
cd "apache-ratis-${RATISVERSION}"
120120

121-
mvnFun clean verify -DskipTests=true -Prelease -Papache-release -Dgpg.keyname="${CODESIGNINGKEY}"
121+
mvnFun clean verify -DskipTests=true -Prelease -Papache-release -Dgpg.keyname="${CODESIGNINGKEY}" "$@"
122122
}
123123

124124
3-publish-mvn() {
@@ -137,7 +137,10 @@ mvnFun() {
137137
for i in *.tar.gz; do gpg --print-md SHA512 "${i}" > "${i}.sha512"; done
138138
for i in *.tar.gz; do gpg --print-mds "${i}" > "${i}.mds"; done
139139
cd "$SVNDISTDIR"
140-
svn add "${RATISVERSION}" || svn add "${RATISVERSION}/${RC#-}"
140+
# skip svn add in CI
141+
if [[ -z "${CI:-}" ]]; then
142+
svn add "${RATISVERSION}" || svn add "${RATISVERSION}/${RC#-}"
143+
fi
141144
}
142145

143146
5-publish-git(){

0 commit comments

Comments
 (0)