Skip to content

chore: Add Kodiak, Renovate, Update pb jar #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/.kodiak.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version = 1

[approve]
auto_approve_usernames = ["cq-bot"]

[merge.message]
body = "pull_request_body"
cut_body_after = "Use the following steps to ensure your PR is ready to be reviewed"
cut_body_and_text = true
cut_body_before = "<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 -->"
title = "pull_request_title"

[merge]
blocking_labels = ["wip", "no automerge"]
notify_on_conflict = false
3 changes: 3 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
extends: ["github>cloudquery/.github//.github/renovate-java-default.json5"],
}
49 changes: 49 additions & 0 deletions .github/workflows/pr_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Validate PR title"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
# Please look up the latest version from
# https://github.com/amannn/action-semantic-pull-request/releases
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure which types are allowed.
# Default: https://github.com/commitizen/conventional-commit-types
types: |
fix
feat
chore
refactor
test
# Configure that a scope must always be provided.
requireScope: false
# If `subjectPattern` is configured, you can use this property to override
# the default error message that is shown when the pattern doesn't match.
# The variables `subject` and `title` can be used within the message.
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
starts with an uppercase character.
# For work-in-progress PRs you can typically use draft pull requests
# from Github. However, private repositories on the free plan don't have
# this option and therefore this action allows you to opt-in to using the
# special "[WIP]" prefix to indicate this state. This will avoid the
# validation of the PR title and the pull request checks remain pending.
# Note that a second check will be reported if this is enabled.
wip: true
# When using "Squash and merge" on a PR with only one commit, GitHub
# will suggest using that commit message instead of the PR title for the
# merge commit, and it's easy to commit this by mistake. Enable this option
# to also validate the commit message for one commit PRs.
validateSingleCommit: false
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: publish
on:
push:
tags:
- 'v*.*.*'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '18'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4
- name: Publish package
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c
with:
arguments: publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: release-please
on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: simple
package-name: plugin-sdk-java
token: ${{ secrets.GH_CQ_BOT }}
pull-request-title-pattern: "chore${scope}: Release${component} v${version}"
# Should breaking changes before 1.0.0 produce minor bumps?
bump-minor-pre-major: true
# Should feat changes before 1.0.0 produce patch bumps instead of minor bumps?
bump-patch-for-minor-pre-major: true
extra-files: |
lib/build.gradle
26 changes: 25 additions & 1 deletion lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
plugins {
id 'java-library'
id "io.freefair.lombok" version "8.1.0"
id "maven-publish"
}

group 'io.cloudquery'
// x-release-please-start-version
version = '0.0.1'
// x-release-please-end

repositories {
maven {
url = uri("https://maven.pkg.github.com/cloudquery/plugin-pb-java")
Expand All @@ -26,7 +32,7 @@ dependencies {
implementation "io.grpc:grpc-stub:1.57.0"
implementation "io.grpc:grpc-services:1.57.0"
implementation "io.grpc:grpc-testing:1.15.1"
implementation 'com.cloudquery:plugin-pb-java:0.0.2'
implementation "io.cloudquery:plugin-pb-java:0.0.5"
}

testing {
Expand All @@ -45,3 +51,21 @@ java {
languageVersion = JavaLanguageVersion.of(20)
}
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/cloudquery/plugin-sdk-java")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.cloudquery.internal.servers.discovery.v1;

import cloudquery.discovery.v1.DiscoveryGrpc.DiscoveryImplBase;
import cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Request;
import cloudquery.discovery.v1.DiscoveryOuterClass.GetVersions.Response;
import io.cloudquery.discovery.v1.DiscoveryGrpc.DiscoveryImplBase;
import io.cloudquery.discovery.v1.GetVersions.Request;
import io.cloudquery.discovery.v1.GetVersions.Response;
import io.grpc.stub.StreamObserver;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.cloudquery.internal.servers.plugin.v3;

import cloudquery.plugin.v3.PluginGrpc.PluginImplBase;
import io.cloudquery.plugin.v3.PluginGrpc.PluginImplBase;
import io.cloudquery.plugin.Plugin;

public class PluginServer extends PluginImplBase {
Expand Down