Skip to content

Commit

Permalink
chore: use release-please GitHub Action for releases (#406)
Browse files Browse the repository at this point in the history
* chore: update release-please to github action and update versions

* add script to update versions with versions maven plugin

* changes to update_versions.sh

* remove maven flatten plugin
  • Loading branch information
shubha-rajan authored Feb 19, 2021
1 parent 03a0935 commit 833e218
Show file tree
Hide file tree
Showing 18 changed files with 101 additions and 70 deletions.
2 changes: 0 additions & 2 deletions .github/release-please.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
package-name: cloud-sql-java-connector
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
target/
*.class
*.iml
*.iml
*.flattened-pom.xml
24 changes: 24 additions & 0 deletions .release/update_versions.sh
Original file line number Diff line number Diff line change
@@ -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
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| -------------------------- | ---------------------------------------- |
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:<LATEST-VERSION>`

[//]: # ({x-version-update-end})

#### Creating the R2DBC URL

Expand Down Expand Up @@ -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
```

---
Expand Down
8 changes: 3 additions & 5 deletions connector-j-5/pom.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-parent</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
<version>1.2.2-SNAPSHOT</version>
</parent>

<artifactId>mysql-socket-factory</artifactId>
<packaging>jar</packaging>

Expand All @@ -29,7 +28,6 @@
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-core</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
8 changes: 3 additions & 5 deletions connector-j-6/pom.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-parent</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
<version>1.2.2-SNAPSHOT</version>
</parent>

<artifactId>mysql-socket-factory-connector-j-6</artifactId>
<packaging>jar</packaging>

Expand Down Expand Up @@ -38,7 +37,6 @@
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-core</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
8 changes: 3 additions & 5 deletions connector-j-8/pom.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-parent</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
<version>1.2.2-SNAPSHOT</version>
</parent>

<artifactId>mysql-socket-factory-connector-j-8</artifactId>
<packaging>jar</packaging>

Expand All @@ -29,7 +28,6 @@
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-core</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
7 changes: 2 additions & 5 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-parent</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
<relativePath>..</relativePath>
<version>1.2.2-SNAPSHOT</version>
</parent>
<artifactId>jdbc-socket-factory-core</artifactId>
<packaging>jar</packaging>
Expand Down
24 changes: 19 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-parent</artifactId>
<packaging>pom</packaging>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
<version>1.2.2-SNAPSHOT</version>


<name>Cloud SQL JDBC Socket Factory</name>
Expand Down Expand Up @@ -80,6 +78,16 @@
<artifactId>reactor-core</artifactId>
<version>3.4.3</version>
</dependency>
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>cloud-sql-connector-r2dbc-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty</artifactId>
Expand Down Expand Up @@ -175,6 +183,12 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.8.1</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
Expand All @@ -184,7 +198,7 @@
<id>enforce</id>
<configuration>
<rules>
<dependencyConvergence/>
<dependencyConvergence />
</rules>
</configuration>
<goals>
Expand Down
7 changes: 2 additions & 5 deletions postgres/pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-parent</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
<version>1.2.2-SNAPSHOT</version>
</parent>
<artifactId>postgres-socket-factory</artifactId>
<packaging>jar</packaging>
Expand All @@ -29,7 +27,6 @@
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-core</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
7 changes: 2 additions & 5 deletions r2dbc-core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-parent</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
<version>1.2.2-SNAPSHOT</version>
</parent>
<artifactId>cloud-sql-connector-r2dbc-core</artifactId>
<packaging>jar</packaging>
Expand All @@ -32,7 +30,6 @@
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-core</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
</dependency>
</dependencies>

Expand Down
7 changes: 2 additions & 5 deletions r2dbc-mysql/pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-parent</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
<version>1.2.2-SNAPSHOT</version>
</parent>
<artifactId>cloud-sql-connector-r2dbc-mysql</artifactId>
<packaging>jar</packaging>
Expand All @@ -33,7 +31,6 @@
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>cloud-sql-connector-r2dbc-core</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
7 changes: 2 additions & 5 deletions r2dbc-postgres/pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-parent</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
<version>1.2.2-SNAPSHOT</version>
</parent>
<artifactId>cloud-sql-connector-r2dbc-postgres</artifactId>
<packaging>jar</packaging>
Expand All @@ -33,7 +31,6 @@
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>cloud-sql-connector-r2dbc-core</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
7 changes: 2 additions & 5 deletions r2dbc-sqlserver/pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.google.cloud.sql</groupId>
<artifactId>jdbc-socket-factory-parent</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
<version>1.2.2-SNAPSHOT</version>
</parent>
<artifactId>cloud-sql-connector-r2dbc-sqlserver</artifactId>
<packaging>jar</packaging>
Expand All @@ -29,7 +27,6 @@
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>cloud-sql-connector-r2dbc-core</artifactId>
<version>1.2.2-SNAPSHOT</version> <!-- {x-version-update:cloud-sql-java-connector:current} -->
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Loading

0 comments on commit 833e218

Please sign in to comment.