Skip to content

Commit e0cc1ef

Browse files
committed
chore: update relese process
1 parent e152e0d commit e0cc1ef

File tree

2 files changed

+50
-20
lines changed

2 files changed

+50
-20
lines changed

.kokoro/release.sh

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@
33
# Stop execution when any command fails.
44
set -e
55

6-
# update the Maven version to 3.6.3
6+
# update the Maven version to 3.9.11
77
pushd /usr/local
8-
wget https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.tar.gz
9-
tar -xvzf apache-maven-3.6.3-bin.tar.gz apache-maven-3.6.3
8+
wget https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.tar.gz
9+
tar -xvzf apache-maven-3.9.11-bin.tar.gz apache-maven-3.9.11
1010
rm -f /usr/local/apache-maven
11-
ln -s /usr/local/apache-maven-3.6.3 /usr/local/apache-maven
12-
rm apache-maven-3.6.3-bin.tar.gz
11+
ln -s /usr/local/apache-maven-3.9.11 /usr/local/apache-maven
12+
rm apache-maven-3.9.11-bin.tar.gz
1313
popd
1414

1515

1616
# Get secrets from keystore and set and environment variables.
1717
setup_environment_secrets() {
1818
export GPG_TTY=$(tty)
19-
export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/75669_functions-framework-java-release-bot-sonatype-password | cut -f1 -d':')
20-
export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/75669_functions-framework-java-release-bot-sonatype-password | cut -f2 -d':')
2119
export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase)
2220

2321
# Add the key ring files to $GNUPGHOME to verify the GPG credentials.
@@ -26,6 +24,29 @@ setup_environment_secrets() {
2624
mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GNUPGHOME/pubring.gpg
2725
mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GNUPGHOME/secring.gpg
2826
gpg -k
27+
28+
echo "KOKORO_GFILE_DIR: ${KOKORO_GFILE_DIR}"
29+
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager"
30+
echo "Creating folder for secrets: ${SECRET_LOCATION} (if not exists)"
31+
mkdir -p "${SECRET_LOCATION}"
32+
echo "Content of ${SECRET_LOCATION}:"
33+
ls -alt "${SECRET_LOCATION}"
34+
echo "------"
35+
36+
export SECRET_MANAGER_PROJECT_ID="serverless-runtimes"
37+
export CENTRAL_REPO_USER="sonatype-central-repo-user"
38+
export CENTRAL_REPO_TOKEN="sonatype-central-repo-token"
39+
SECRET_MANAGER_KEYS="${CENTRAL_REPO_USER} ${CENTRAL_REPO_TOKEN}"
40+
echo "SECRET_MANAGER_PROJECT_ID: ${SECRET_MANAGER_PROJECT_ID}, SECRET_MANAGER_KEYS: ${SECRET_MANAGER_KEYS}"
41+
42+
for key in $(echo "${SECRET_MANAGER_KEYS}" | sed "s/,/ /g")
43+
do
44+
gcloud secrets versions access latest \
45+
--project "${SECRET_MANAGER_PROJECT_ID}" \
46+
--secret "${key}" \
47+
--out-file "${SECRET_LOCATION}/${key}"
48+
echo "Created ${SECRET_LOCATION}/${key}"
49+
done
2950
}
3051

3152
create_settings_xml_file() {
@@ -42,14 +63,10 @@ create_settings_xml_file() {
4263
</profiles>
4364
<servers>
4465
<server>
45-
<id>sonatype-nexus-staging</id>
46-
<username>${SONATYPE_USERNAME}</username>
47-
<password>${SONATYPE_PASSWORD}</password>
66+
<id>sonatype-central-portal</id>
67+
<username>$(cat "${SECRET_LOCATION}/${CENTRAL_REPO_USER}")</username>
68+
<password>$(cat "${SECRET_LOCATION}/${CENTRAL_REPO_TOKEN}")</password>
4869
</server>
49-
<server>
50-
<id>sonatype-nexus-snapshots</id>
51-
<username>${SONATYPE_USERNAME}</username>
52-
<password>${SONATYPE_PASSWORD}</password>
5370
</server>
5471
</servers>
5572
</settings>" > $1

function-maven-plugin/pom.xml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,21 @@
2323
<tag>HEAD</tag>
2424
</scm>
2525

26+
<developers>
27+
<developer>
28+
<name>Andras Kerekes</name>
29+
<email>[email protected]</email>
30+
<organization>Google LLC</organization>
31+
<organizationUrl>http://www.google.com</organizationUrl>
32+
</developer>
33+
<developer>
34+
<name>Di Xu</name>
35+
<email>[email protected]</email>
36+
<organization>Google LLC</organization>
37+
<organizationUrl>http://www.google.com</organizationUrl>
38+
</developer>
39+
</developers>
40+
2641
<licenses>
2742
<license>
2843
<name>Apache License, Version 2.0</name>
@@ -159,14 +174,12 @@
159174
</executions>
160175
</plugin>
161176
<plugin>
162-
<groupId>org.sonatype.plugins</groupId>
163-
<artifactId>nexus-staging-maven-plugin</artifactId>
164-
<version>1.7.0</version>
177+
<groupId>org.sonatype.central</groupId>
178+
<artifactId>central-publishing-maven-plugin</artifactId>
179+
<version>0.9.0</version>
165180
<extensions>true</extensions>
166181
<configuration>
167-
<serverId>sonatype-nexus-snapshots</serverId>
168-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
169-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
182+
<publishingServerId>sonatype-central-portal</publishingServerId>
170183
</configuration>
171184
</plugin>
172185
</plugins>

0 commit comments

Comments
 (0)