diff --git a/.github/release-please.yml b/.github/release-please.yml deleted file mode 100644 index f585715a4..000000000 --- a/.github/release-please.yml +++ /dev/null @@ -1,2 +0,0 @@ -releaseType: java-yoshi -handleGHRelease: true diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 000000000..f5ffc718f --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,28 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: release-please +on: + push: + branches: + - master +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v2.18.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: simple + package-name: cloud-sql-java-connector \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6ac8c87c2..973300cda 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ target/ *.class -*.iml +*.iml +*.flattened-pom.xml \ No newline at end of file diff --git a/.release/update_versions.sh b/.release/update_versions.sh new file mode 100755 index 000000000..9deeb061f --- /dev/null +++ b/.release/update_versions.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2021 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +VERSION=$(cat version.txt) +# Update parent pom version +mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false + +# Update versions in README if not snapshot release +if ! [[ $VERSION =~ .*SNAPSHOT ]] +then + sed -Ei '' 's/[0-9]+\.[0-9]+\.[0-9]+/'"$VERSION"'/g' README.md +fi \ No newline at end of file diff --git a/README.md b/README.md index 2f839eb85..cfc829fe4 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ gcloud auth application-default login **Note**: Use your JDBC driver version to figure out which SocketFactory you should use. If you are unsure, it is recommended to use the latest version of `mysql-connector-java:8.x`. -[//]: # ({x-version-update-start:cloud-sql-java-connector:released}) | JDBC Driver Version | Cloud SQL Socket Factory Version | | -------------------------- | ---------------------------------------- | @@ -98,7 +97,6 @@ compile 'com.google.cloud.sql:cloud-sql-connector-jdbc-sqlserver:1.2.1' ``` -[//]: # ({x-version-update-end}) #### Creating the JDBC URL @@ -148,7 +146,7 @@ Note: The host portion of the JDBC URL is currently unused, and has no effect on ### Add library as a dependency -[//]: # ({x-version-update-start:cloud-sql-java-connector:released}) + #### MySQL @@ -206,7 +204,6 @@ compile 'com.google.cloud.sql:cloud-sql-connector-r2dbc-sqlserver:1.2.1' ``` *Note: Also include the R2DBC Driver for SQL Server, `io.r2dbc:r2dbc-mssql:` -[//]: # ({x-version-update-end}) #### Creating the R2DBC URL @@ -259,8 +256,8 @@ This will create a *target* sub-folder within each of the module directories. Wi Example: ``` -mysql-socket-factory-connector-j-8–1.0.16-jar-with-dependencies.jar -postgres-socket-factory-1.0.16-jar-with-dependencies.jar +mysql-socket-factory-connector-j-8–1.2.1-jar-with-dependencies.jar +postgres-socket-factory-1.2.1-jar-with-dependencies.jar ``` --- diff --git a/connector-j-5/pom.xml b/connector-j-5/pom.xml index 75d094ee0..3d5ae7e38 100644 --- a/connector-j-5/pom.xml +++ b/connector-j-5/pom.xml @@ -1,14 +1,13 @@ - + 4.0.0 com.google.cloud.sql jdbc-socket-factory-parent - 1.2.2-SNAPSHOT + 1.2.2-SNAPSHOT + mysql-socket-factory jar @@ -29,7 +28,6 @@ com.google.cloud.sql jdbc-socket-factory-core - 1.2.2-SNAPSHOT junit diff --git a/connector-j-6/pom.xml b/connector-j-6/pom.xml index 9b38f8dba..128bc946f 100644 --- a/connector-j-6/pom.xml +++ b/connector-j-6/pom.xml @@ -1,14 +1,13 @@ - + 4.0.0 com.google.cloud.sql jdbc-socket-factory-parent - 1.2.2-SNAPSHOT + 1.2.2-SNAPSHOT + mysql-socket-factory-connector-j-6 jar @@ -38,7 +37,6 @@ com.google.cloud.sql jdbc-socket-factory-core - 1.2.2-SNAPSHOT junit diff --git a/connector-j-8/pom.xml b/connector-j-8/pom.xml index 37ef0d74d..87eb6fc0a 100644 --- a/connector-j-8/pom.xml +++ b/connector-j-8/pom.xml @@ -1,14 +1,13 @@ - + 4.0.0 com.google.cloud.sql jdbc-socket-factory-parent - 1.2.2-SNAPSHOT + 1.2.2-SNAPSHOT + mysql-socket-factory-connector-j-8 jar @@ -29,7 +28,6 @@ com.google.cloud.sql jdbc-socket-factory-core - 1.2.2-SNAPSHOT junit diff --git a/core/pom.xml b/core/pom.xml index ce87ff528..184ed2dc6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -1,14 +1,11 @@ - + 4.0.0 com.google.cloud.sql jdbc-socket-factory-parent - 1.2.2-SNAPSHOT - .. + 1.2.2-SNAPSHOT jdbc-socket-factory-core jar diff --git a/pom.xml b/pom.xml index 7f9b9ed06..f80f618ba 100644 --- a/pom.xml +++ b/pom.xml @@ -1,13 +1,11 @@ - + 4.0.0 com.google.cloud.sql jdbc-socket-factory-parent pom - 1.2.2-SNAPSHOT + 1.2.2-SNAPSHOT Cloud SQL JDBC Socket Factory @@ -80,6 +78,16 @@ reactor-core 3.4.3 + + com.google.cloud.sql + cloud-sql-connector-r2dbc-core + ${project.version} + + + com.google.cloud.sql + jdbc-socket-factory-core + ${project.version} + io.projectreactor.netty reactor-netty @@ -175,6 +183,12 @@ + + org.codehaus.mojo + versions-maven-plugin + 2.8.1 + + org.apache.maven.plugins maven-enforcer-plugin @@ -184,7 +198,7 @@ enforce - + diff --git a/postgres/pom.xml b/postgres/pom.xml index 58cdb4146..c8d48e54d 100644 --- a/postgres/pom.xml +++ b/postgres/pom.xml @@ -1,13 +1,11 @@ - + 4.0.0 com.google.cloud.sql jdbc-socket-factory-parent - 1.2.2-SNAPSHOT + 1.2.2-SNAPSHOT postgres-socket-factory jar @@ -29,7 +27,6 @@ com.google.cloud.sql jdbc-socket-factory-core - 1.2.2-SNAPSHOT junit diff --git a/r2dbc-core/pom.xml b/r2dbc-core/pom.xml index 9976663c8..bfcd92e57 100644 --- a/r2dbc-core/pom.xml +++ b/r2dbc-core/pom.xml @@ -1,13 +1,11 @@ - + 4.0.0 com.google.cloud.sql jdbc-socket-factory-parent - 1.2.2-SNAPSHOT + 1.2.2-SNAPSHOT cloud-sql-connector-r2dbc-core jar @@ -32,7 +30,6 @@ com.google.cloud.sql jdbc-socket-factory-core - 1.2.2-SNAPSHOT diff --git a/r2dbc-mysql/pom.xml b/r2dbc-mysql/pom.xml index 534bde0ef..e85c01495 100644 --- a/r2dbc-mysql/pom.xml +++ b/r2dbc-mysql/pom.xml @@ -1,13 +1,11 @@ - + 4.0.0 com.google.cloud.sql jdbc-socket-factory-parent - 1.2.2-SNAPSHOT + 1.2.2-SNAPSHOT cloud-sql-connector-r2dbc-mysql jar @@ -33,7 +31,6 @@ com.google.cloud.sql cloud-sql-connector-r2dbc-core - 1.2.2-SNAPSHOT junit diff --git a/r2dbc-postgres/pom.xml b/r2dbc-postgres/pom.xml index 5c360a386..ebd3c19c0 100644 --- a/r2dbc-postgres/pom.xml +++ b/r2dbc-postgres/pom.xml @@ -1,13 +1,11 @@ - + 4.0.0 com.google.cloud.sql jdbc-socket-factory-parent - 1.2.2-SNAPSHOT + 1.2.2-SNAPSHOT cloud-sql-connector-r2dbc-postgres jar @@ -33,7 +31,6 @@ com.google.cloud.sql cloud-sql-connector-r2dbc-core - 1.2.2-SNAPSHOT junit diff --git a/r2dbc-sqlserver/pom.xml b/r2dbc-sqlserver/pom.xml index 2ad83a86a..e48f31e17 100644 --- a/r2dbc-sqlserver/pom.xml +++ b/r2dbc-sqlserver/pom.xml @@ -1,13 +1,11 @@ - + 4.0.0 com.google.cloud.sql jdbc-socket-factory-parent - 1.2.2-SNAPSHOT + 1.2.2-SNAPSHOT cloud-sql-connector-r2dbc-sqlserver jar @@ -29,7 +27,6 @@ com.google.cloud.sql cloud-sql-connector-r2dbc-core - 1.2.2-SNAPSHOT junit diff --git a/sqlserver/pom.xml b/sqlserver/pom.xml index adc378a3a..ee1fe745b 100644 --- a/sqlserver/pom.xml +++ b/sqlserver/pom.xml @@ -1,14 +1,11 @@ - + 4.0.0 com.google.cloud.sql jdbc-socket-factory-parent - 1.2.2-SNAPSHOT - .. + 1.2.2-SNAPSHOT cloud-sql-connector-jdbc-sqlserver jar @@ -28,8 +25,7 @@ com.google.cloud.sql - jdbc-socket-factory-core - 1.2.2-SNAPSHOT + jdbc-socket-factory-core junit diff --git a/version.txt b/version.txt new file mode 100644 index 000000000..f98c6352e --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.2.2-SNAPSHOT \ No newline at end of file diff --git a/versions.txt b/versions.txt deleted file mode 100644 index cd2470774..000000000 --- a/versions.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Format: -# module:released-version:current-version - -cloud-sql-java-connector:1.2.1:1.2.2-SNAPSHOT