Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Commit 7cd7e13

Browse files
authored
chore: Release with maven (#1894)
* chore: Release with maven * chore: Update configs * chore: Remove maven_build.sh file * chore: Prepare maven release * chore: Clean up build file
1 parent 735468e commit 7cd7e13

22 files changed

+113
-525
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,9 @@ jobs:
1919
distribution: temurin
2020
java-version: 11
2121
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
22-
- run: .kokoro/maven-build.sh
22+
- run: .kokoro/build.sh
2323
env:
2424
JOB_TYPE: clirr
25-
maven-units:
26-
name: "maven unit tests"
27-
runs-on: ubuntu-latest
28-
steps:
29-
- uses: actions/checkout@v3
30-
- uses: actions/setup-java@v3
31-
with:
32-
java-version: 8
33-
distribution: zulu
34-
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
35-
- uses: actions/setup-java@v3
36-
with:
37-
java-version: 11
38-
distribution: zulu
39-
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
40-
- run: printenv
41-
- run: .kokoro/maven-build.sh
42-
env:
43-
JOB_TYPE: test
4425
units-java11:
4526
name: "units (11)"
4627
runs-on: ubuntu-latest

.kokoro/build.sh

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2018 Google Inc.
2+
# Copyright 2018 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -34,29 +34,27 @@ if [ ! -z "${JAVA11_HOME}" ]; then
3434
setJava "${JAVA11_HOME}"
3535
fi
3636

37-
echo "Compiling using Java:"
38-
java -version
39-
echo
40-
./gradlew compileJava compileTestJava javadoc
37+
mvn -V -B -ntp clean install -DskipTests
4138

4239
# We ensure the generated class files are compatible with Java 8
4340
if [ ! -z "${JAVA8_HOME}" ]; then
4441
setJava "${JAVA8_HOME}"
4542
fi
4643

47-
echo "Running tests using Java:"
48-
java -version
49-
50-
if [ "${GITHUB_JOB}" == "units-java8" ]; then
51-
java -version 2>&1 | grep -q 'openjdk version "1.8.'
52-
MATCH=$? # 0 if the output has the match
53-
if [ "$MATCH" != "0" ]; then
54-
echo "Please specify JDK 8 for Java 8 tests"
55-
exit 1
56-
fi
57-
fi
58-
59-
echo
60-
./gradlew build publishToMavenLocal \
61-
--exclude-task compileJava --exclude-task compileTestJava \
62-
--exclude-task javadoc
44+
RETURN_CODE=0
45+
46+
case "${JOB_TYPE}" in
47+
test)
48+
# run tests in Java 8 with the source compiled in Java 11
49+
mvn -V -B -ntp surefire:test
50+
RETURN_CODE=$?
51+
;;
52+
clirr)
53+
mvn -B -ntp clirr:check
54+
RETURN_CODE=$?
55+
;;
56+
*) ;;
57+
esac
58+
59+
echo "exiting with ${RETURN_CODE}"
60+
exit ${RETURN_CODE}

.kokoro/maven-build.sh

Lines changed: 0 additions & 72 deletions
This file was deleted.

.kokoro/release/common.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2019 Google Inc.
2+
# Copyright 2019 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -28,17 +28,6 @@ setup_environment_secrets() {
2828
export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|')
2929
}
3030

31-
create_gradle_properties_file() {
32-
echo "
33-
signing.gnupg.executable=gpg
34-
signing.gnupg.homeDir=${GPG_HOMEDIR}
35-
signing.gnupg.keyName=${GPG_KEY_ID}
36-
signing.gnupg.passphrase=${GPG_PASSPHRASE}
37-
38-
ossrhUsername=${SONATYPE_USERNAME}
39-
ossrhPassword=${SONATYPE_PASSWORD}" > $1
40-
}
41-
4231
create_settings_xml_file() {
4332
echo "
4433
<settings>

.kokoro/release/drop.cfg

Lines changed: 0 additions & 5 deletions
This file was deleted.

.kokoro/release/drop.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

.kokoro/release/promote.cfg

Lines changed: 0 additions & 5 deletions
This file was deleted.

.kokoro/release/promote.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

.kokoro/release/publish_javadoc.cfg

Lines changed: 0 additions & 19 deletions
This file was deleted.

.kokoro/release/publish_javadoc.sh

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)