Skip to content
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

Release Java packages #168

Closed
rmichela opened this issue Apr 9, 2019 · 22 comments
Closed

Release Java packages #168

rmichela opened this issue Apr 9, 2019 · 22 comments
Labels
Java Java/JVM language support

Comments

@rmichela
Copy link
Contributor

rmichela commented Apr 9, 2019

Java bindings have been implemented in #54. I have access to the io.envoyproxy maven namespace. If we agree it's time, I'll do the release of version 0.1.0. @rodaine

@rmichela
Copy link
Contributor Author

How java-control-plane does java releases. https:/envoyproxy/java-control-plane/blob/master/.circleci/config.yml#L36-L51

@rmichela
Copy link
Contributor Author

For the first Java release, do we want full CI integration like java-control-plane, or can I just do a manual push from my laptop?

@snowp
Copy link
Contributor

snowp commented Apr 15, 2019

I think it would make sense to set up CI if that's where we want to end up down the line

@rmichela
Copy link
Contributor Author

rmichela commented Apr 16, 2019

I talked to @joeyb about how he set up automatic promotion for java-control-plane with CircleCI. We need to do the following.

  1. Create a release bot account like @envoy-java-control-plane-bot, and give it committer rights to this github repo.
  2. Generate a fresh GPG signing key, and register its public key with a GPG key registry.
  3. Create a Sonatype account with publish rights for io.envoyproxy for use in automation.
  4. Register environment variables in CircleCI for
    • SONATYPE_USER
    • SONATYPE_PASSWORD
    • GPG_KEY (base64 encoded key)
    • GPG_KEY_NAME
    • GPG_PASSPHRASE
  5. Register release bot SSH key in CircleCI project
  6. Configure maven-release-plugin in top-level pom.xml to do version stamp upgrade
  7. Set up CircleCI build for Java
  8. Kick off CircleCI build with parameters with curl
    curl -X POST -H "Content-Type: application/json" -d '{
    "build_parameters": {
        "RELEASE": "0.1.0",
        "NEXT": "0.2.0-SNAPSHOT",
        "GIT_USER_EMAIL": "[email protected]",
        "GIT_USER_NAME": "Via CircleCI"
    }}' "https://circleci.com/api/v1.1/project/github/envoyproxy/protoc-gen-validate/tree/master?circle-token=<my-token>"
    

@rmichela
Copy link
Contributor Author

rmichela commented May 4, 2019

Snapshot artifacts have been released to Sonatype 🎉

https://oss.sonatype.org/content/repositories/snapshots/io/envoyproxy/protoc-gen-validate/

@rmichela
Copy link
Contributor Author

rmichela commented May 4, 2019

@rodaine Can you please execute the above curl command to try a real release?

@rmichela
Copy link
Contributor Author

rmichela commented May 7, 2019

Waiting on resolution of #185 in #186 before releasing official release bits.

@nicktrav
Copy link

Hey @rmichela - how's this one looking?

@rmichela
Copy link
Contributor Author

Soon after #186 is merged.

@rmichela
Copy link
Contributor Author

A new snapshot has been promoted.

@skyrocknroll
Copy link

Awesome ! Thanks

@rmichela
Copy link
Contributor Author

Just fixed #210. Waiting on merge.

@rmichela
Copy link
Contributor Author

Working on #208.

@rmichela rmichela added the Java Java/JVM language support label May 30, 2019
@nicktrav
Copy link

@rmichela - any remaining blockers to publishing an official (non-snapshot) release? #208 looks like it got resolved.

@rmichela
Copy link
Contributor Author

Everything is ready. I'm going to try do do a 0.1.0 release today.

@rmichela
Copy link
Contributor Author

rmichela commented Jun 13, 2019

Release jars are now public in Maven Central. 🎉 https://search.maven.org/search?q=io.envoyproxy.protoc-gen-validate

FYI #193

@LethiferousMoose
Copy link

@rmichela Does anyone have an example of how to use this in Gradle, I can keep playing around with till I get it to work, but an example would be nice.

@nicktrav
Copy link

@LethiferousMoose - something like this works for us:

plugins {
    ...
    id "com.google.protobuf" version "0.8.6"
    ...
}

protobuf {
    protoc {
        artifact = "com.google.protobuf:protoc:3.5.1"
    }

    plugins {
        javapgv {
            artifact = "io.envoyproxy.protoc-gen-validate:protoc-gen-validate:0.1.0"
        }
    }

    generateProtoTasks {
        all()*.plugins {
            javapgv {
                option "lang=java"
            }
        }
    }
}

Plus the respective dependencies for compile, etc., depending on how you're using it.

@LethiferousMoose
Copy link

LethiferousMoose commented Jun 19, 2019

@nicktrav Huh, I pretty much have exactly that.

I end up getting an error like this:

Execution failed for task ':testService:generateProto'.
> protoc: stdout: . stderr: C:\dev\master\TestProject\testService\build/generated/source/proto/main/javapgv/com\jda\api\testservice\v1\TestResourcesValidator.java: No such file or directory

@Fleshgrinder
Copy link
Contributor

Fleshgrinder commented Jun 19, 2019

This seems to be a typical Windows issue like seen in marcoferrer/kroto-plus#6 as well. There are also a couple of workarounds being discussed. I think that in general running protoc plugins on Windows is too complicated because the way the Protobuf Gradle plugin is designed.

@LethiferousMoose
Copy link

LethiferousMoose commented Jun 19, 2019

I had a co-worker on Mac test it and it does appear to be only affecting Windows machines.
Just looked at #191, looks like my issue is also tied to an older version of protoc (3.5.0). So it's not a fault in the plugin.

@rmichela
Copy link
Contributor Author

The /generated/source/proto/main/javapgv/ part of the path is owned by protoc itself. It may be fixed in future versions of protobuf.

@rmichela rmichela mentioned this issue Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java Java/JVM language support
Projects
None yet
Development

No branches or pull requests

6 participants