Skip to content

Commit efe4e38

Browse files
authored
chore: Add Kodiak, Renovate, Update pb jar (#8)
Similar release flow to https://github.com/cloudquery/plugin-pb-java, plus dependency updates, plus `automerge` for PRs plus updating to latest `io.cloudquery` pb jar
1 parent 0cfda31 commit efe4e38

File tree

8 files changed

+144
-5
lines changed

8 files changed

+144
-5
lines changed

.github/.kodiak.toml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version = 1
2+
3+
[approve]
4+
auto_approve_usernames = ["cq-bot"]
5+
6+
[merge.message]
7+
body = "pull_request_body"
8+
cut_body_after = "Use the following steps to ensure your PR is ready to be reviewed"
9+
cut_body_and_text = true
10+
cut_body_before = "<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 -->"
11+
title = "pull_request_title"
12+
13+
[merge]
14+
blocking_labels = ["wip", "no automerge"]
15+
notify_on_conflict = false

.github/renovate.json5

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
extends: ["github>cloudquery/.github//.github/renovate-java-default.json5"],
3+
}

.github/workflows/pr_title.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Validate PR title"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Please look up the latest version from
16+
# https://github.com/amannn/action-semantic-pull-request/releases
17+
- uses: amannn/action-semantic-pull-request@v5
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
with:
21+
# Configure which types are allowed.
22+
# Default: https://github.com/commitizen/conventional-commit-types
23+
types: |
24+
fix
25+
feat
26+
chore
27+
refactor
28+
test
29+
# Configure that a scope must always be provided.
30+
requireScope: false
31+
# If `subjectPattern` is configured, you can use this property to override
32+
# the default error message that is shown when the pattern doesn't match.
33+
# The variables `subject` and `title` can be used within the message.
34+
subjectPatternError: |
35+
The subject "{subject}" found in the pull request title "{title}"
36+
didn't match the configured pattern. Please ensure that the subject
37+
starts with an uppercase character.
38+
# For work-in-progress PRs you can typically use draft pull requests
39+
# from Github. However, private repositories on the free plan don't have
40+
# this option and therefore this action allows you to opt-in to using the
41+
# special "[WIP]" prefix to indicate this state. This will avoid the
42+
# validation of the PR title and the pull request checks remain pending.
43+
# Note that a second check will be reported if this is enabled.
44+
wip: true
45+
# When using "Squash and merge" on a PR with only one commit, GitHub
46+
# will suggest using that commit message instead of the PR title for the
47+
# merge commit, and it's easy to commit this by mistake. Enable this option
48+
# to also validate the commit message for one commit PRs.
49+
validateSingleCommit: false

.github/workflows/publish.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: publish
2+
on:
3+
push:
4+
tags:
5+
- 'v*.*.*'
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
- uses: actions/setup-java@v3
14+
with:
15+
distribution: 'temurin'
16+
java-version: '18'
17+
cache: 'gradle'
18+
- name: Validate Gradle wrapper
19+
uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4
20+
- name: Publish package
21+
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c
22+
with:
23+
arguments: publish
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release_pr.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: release-please
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
release-please:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: google-github-actions/release-please-action@v3
12+
id: release
13+
with:
14+
release-type: simple
15+
package-name: plugin-sdk-java
16+
token: ${{ secrets.GH_CQ_BOT }}
17+
pull-request-title-pattern: "chore${scope}: Release${component} v${version}"
18+
# Should breaking changes before 1.0.0 produce minor bumps?
19+
bump-minor-pre-major: true
20+
# Should feat changes before 1.0.0 produce patch bumps instead of minor bumps?
21+
bump-patch-for-minor-pre-major: true
22+
extra-files: |
23+
lib/build.gradle

lib/build.gradle

+25-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
plugins {
22
id 'java-library'
33
id "io.freefair.lombok" version "8.1.0"
4+
id "maven-publish"
45
}
56

7+
group 'io.cloudquery'
8+
// x-release-please-start-version
9+
version = '0.0.1'
10+
// x-release-please-end
11+
612
repositories {
713
maven {
814
url = uri("https://maven.pkg.github.com/cloudquery/plugin-pb-java")
@@ -26,7 +32,7 @@ dependencies {
2632
implementation "io.grpc:grpc-stub:1.57.0"
2733
implementation "io.grpc:grpc-services:1.57.0"
2834
implementation "io.grpc:grpc-testing:1.15.1"
29-
implementation 'com.cloudquery:plugin-pb-java:0.0.2'
35+
implementation "io.cloudquery:plugin-pb-java:0.0.5"
3036
}
3137

3238
testing {
@@ -45,3 +51,21 @@ java {
4551
languageVersion = JavaLanguageVersion.of(20)
4652
}
4753
}
54+
55+
publishing {
56+
repositories {
57+
maven {
58+
name = "GitHubPackages"
59+
url = uri("https://maven.pkg.github.com/cloudquery/plugin-sdk-java")
60+
credentials {
61+
username = System.getenv("GITHUB_ACTOR")
62+
password = System.getenv("GITHUB_TOKEN")
63+
}
64+
}
65+
}
66+
publications {
67+
gpr(MavenPublication) {
68+
from(components.java)
69+
}
70+
}
71+
}

lib/src/main/java/io/cloudquery/internal/servers/discovery/v1/DiscoverServer.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package io.cloudquery.internal.servers.discovery.v1;
22

3-
import cloudquery.discovery.v1.DiscoveryGrpc.DiscoveryImplBase;
4-
import cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request;
5-
import cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response;
3+
import io.cloudquery.discovery.v1.DiscoveryGrpc.DiscoveryImplBase;
4+
import io.cloudquery.discovery.v1.GetVersions.Request;
5+
import io.cloudquery.discovery.v1.GetVersions.Response;
66
import io.grpc.stub.StreamObserver;
77

88
import java.util.List;

lib/src/main/java/io/cloudquery/internal/servers/plugin/v3/PluginServer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.cloudquery.internal.servers.plugin.v3;
22

3-
import cloudquery.plugin.v3.PluginGrpc.PluginImplBase;
3+
import io.cloudquery.plugin.v3.PluginGrpc.PluginImplBase;
44
import io.cloudquery.plugin.Plugin;
55

66
public class PluginServer extends PluginImplBase {

0 commit comments

Comments
 (0)