Skip to content
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
14 changes: 8 additions & 6 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ GUAVA_VERSION = "33.4.8"

TRUTH_VERSION = "1.4.4"

PROTOBUF_JAVA_VERSION = "4.32.0"

# Compile only artifacts
[
maven.artifact(
Expand All @@ -49,7 +51,7 @@ TRUTH_VERSION = "1.4.4"
)
for group, artifact, version in [coord.split(":") for coord in [
"com.google.code.findbugs:annotations:3.0.1",
"com.google.errorprone:error_prone_annotations:2.38.0",
"com.google.errorprone:error_prone_annotations:2.41.0",
]]
]

Expand Down Expand Up @@ -80,15 +82,15 @@ maven.install(
"com.google.auto.value:auto-value:1.11.0",
"com.google.auto.value:auto-value-annotations:1.11.0",
"com.google.guava:guava:" + GUAVA_VERSION + "-jre",
"com.google.protobuf:protobuf-java:4.31.0",
"com.google.protobuf:protobuf-java-util:4.31.0",
"com.google.protobuf:protobuf-java:" + PROTOBUF_JAVA_VERSION,
"com.google.protobuf:protobuf-java-util:" + PROTOBUF_JAVA_VERSION,
"com.google.re2j:re2j:1.8",
"info.picocli:picocli:4.7.7",
"org.antlr:antlr4-runtime:4.13.2",
"org.freemarker:freemarker:2.3.34",
"org.jspecify:jspecify:1.0.0",
"org.threeten:threeten-extra:1.8.0",
"org.yaml:snakeyaml:2.4",
"org.yaml:snakeyaml:2.5",
],
repositories = [
"https://maven.google.com",
Expand All @@ -100,7 +102,7 @@ maven.install(
# keep sorted
artifacts = [
"com.google.guava:guava:" + GUAVA_VERSION + "-android",
"com.google.protobuf:protobuf-javalite:4.31.0",
"com.google.protobuf:protobuf-javalite:" + PROTOBUF_JAVA_VERSION,
],
repositories = [
"https://maven.google.com",
Expand All @@ -112,7 +114,7 @@ maven.install(

maven.install(
name = "maven_conformance",
artifacts = ["dev.cel:cel:0.11.0-SNAPSHOT"],
artifacts = ["dev.cel:cel:0.11.0"],
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ CEL-Java is available in Maven Central Repository. [Download the JARs here][8] o
<dependency>
<groupId>dev.cel</groupId>
<artifactId>cel</artifactId>
<version>0.10.1</version>
<version>0.11.0</version>
</dependency>
```

**Gradle**

```gradle
implementation 'dev.cel:cel:0.10.1'
implementation 'dev.cel:cel:0.11.0'
```

Then run this example:
Expand Down
1 change: 1 addition & 0 deletions conformance/src/test/java/dev/cel/conformance/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ java_library(
tags = ["conformance_maven"],
deps = MAVEN_JAR_DEPS + [
"//:java_truth",
"//parser:parser_factory", # TODO: Remove next OSS release
"//testing:expr_value_utils",
"@cel_spec//proto/cel/expr:expr_java_proto",
"@cel_spec//proto/cel/expr/conformance/proto2:test_all_types_java_proto",
Expand Down
1 change: 1 addition & 0 deletions publish/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ LITE_RUNTIME_TARGETS = [

COMPILER_TARGETS = [
"//parser/src/main/java/dev/cel/parser",
"//parser/src/main/java/dev/cel/parser:parser_factory",
"//parser/src/main/java/dev/cel/parser:parser_builder",
"//parser/src/main/java/dev/cel/parser:unparser",
"//checker/src/main/java/dev/cel/checker:checker",
Expand Down
2 changes: 1 addition & 1 deletion publish/cel_version.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Maven artifact version for CEL."""
CEL_VERSION = "0.10.1"
CEL_VERSION = "0.11.0"
65 changes: 48 additions & 17 deletions publish/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,59 @@
# 1. You must create a pgp certificate and upload it to keyserver.ubuntu.com. See https://blog.sonatype.com/2010/01/how-to-generate-pgp-signatures-with-maven/
# 2. You will need to enter the key's password. The prompt appears in GUI, not in terminal. The publish operation will eventually timeout if the password is not entered.

# Note, to run script: Bazel and jq are required

ALL_TARGETS=("//publish:cel.publish" "//publish:cel_compiler.publish" "//publish:cel_runtime.publish" "//publish:cel_v1alpha1.publish" "//publish:cel_protobuf.publish" "//publish:cel_runtime_android.publish")
JDK8_FLAGS="--java_language_version=8 --java_runtime_version=8"

function publish_maven_remote() {
maven_repo_url=$1
# Credentials should be read from maven config (settings.xml) once it
# is supported by bazelbuild:
# https://github.com/bazelbuild/rules_jvm_external/issues/679
read -p "maven_user: " maven_user
read -s -p "maven_password: " maven_password
for PUBLISH_TARGET in "${ALL_TARGETS[@]}"
do
bazel run --stamp \
--define "maven_repo=$maven_repo_url" \
--define gpg_sign=true \
--define "maven_user=$maven_user" \
--define "maven_password=$maven_password" \
$PUBLISH_TARGET \
$JDK8_FLAGS
done
# Credentials should be read from maven config (settings.xml) once it
# is supported by bazelbuild:
# https://github.com/bazelbuild/rules_jvm_external/issues/679
read -p "maven_user: " maven_user
read -s -p "maven_password: " maven_password

# Upload artifacts to staging repository
for PUBLISH_TARGET in "${ALL_TARGETS[@]}"
do
bazel run --stamp \
--define "maven_repo=$maven_repo_url" \
--define gpg_sign=true \
--define "maven_user=$maven_user" \
--define "maven_password=$maven_password" \
$PUBLISH_TARGET \
$JDK8_FLAGS
done

# Begin creating a staging deployment in central maven
auth_token=$(printf "%s:%s" "$maven_user" "$maven_password" | base64)
repository_key=$(curl -s -X GET \
-H "Authorization:Bearer $auth_token" \
"https://ossrh-staging-api.central.sonatype.com/manual/search/repositories?ip=any&profile_id=dev.cel" | \
jq -r '.repositories[] | select(.state=="open") | .key' | head -n 1)
echo ""
if [[ -n "$repository_key" ]]; then
echo "Open repository key:"
echo "$repository_key"

echo "Creating deployment..."
post_response=$(curl -s -w "\n%{http_code}" -X POST \
-H "Authorization: Bearer $auth_token" \
"https://ossrh-staging-api.central.sonatype.com/manual/upload/repository/$repository_key")

http_code=$(tail -n1 <<< "$post_response")
response_body=$(sed '$ d' <<< "$post_response")

echo "----------------------------------------"
echo "Deployment API Response (HTTP Status: $http_code):"
echo "$response_body"
echo "----------------------------------------"
echo ""
echo "Proceed to https://central.sonatype.com/publishing/deployments to finalize publishing."
else
echo "No open repository was found. Likely an indication that artifacts were not uploaded."
fi
}

version=$(<cel_version.bzl)
Expand All @@ -58,7 +89,7 @@ if [ "$flag" == "--snapshot" ] || [ "$flag" == "-s" ]; then
exit 1;
fi
echo "Publishing a SNAPSHOT version: $version to remote Maven repository"
publish_maven_remote "https://s01.oss.sonatype.org/content/repositories/snapshots/"
publish_maven_remote "https://central.sonatype.com/repository/maven-snapshots/"
elif [ "$flag" == "--release" ] || [ "$flag" == "-r" ]; then
if [[ $version == *"-SNAPSHOT"* ]]; then
echo "Unable to publish. Please remove -SNAPSHOT suffix from CEL Version"
Expand All @@ -69,7 +100,7 @@ elif [ "$flag" == "--release" ] || [ "$flag" == "-r" ]; then
read -p "Proceed (Y/N)? " yn
case $yn in
[Yy]* )
publish_maven_remote "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
publish_maven_remote "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
Expand Down
Loading