Skip to content

Commit

Permalink
Merge pull request #16 from cryptimeleon/release/1.0.0
Browse files Browse the repository at this point in the history
Release/1.0.0
  • Loading branch information
feidens authored Mar 19, 2021
2 parents 8f2b813 + 3f86231 commit dacbaa9
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 34 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/ci.yaml → .github/workflows/dev-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
name: Java CI
name: Development Java CI

on: push
on:
push:
branches-ignore:
- main
- 'release/**'
pull_request:
branches:
- develop
# Nightly builds to ensure dependencies don't break anything
schedule:
- cron: '0 0 * * *'

jobs:
build:
Expand All @@ -16,4 +26,4 @@ jobs:
chmod +x install_mcl.sh
./install_mcl.sh $JAVA_HOME/include
- name: Build with Gradle
run: ./gradlew build -PcheckoutIfCloned=true
run: ./gradlew build -PcheckoutIfCloned
32 changes: 32 additions & 0 deletions .github/workflows/pub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publishing

on:
push:
branches:
- main
tags:
- v[1-9]+.[0-9]+.[0-9]+
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Publish to the Maven Central Repository
run: ./gradlew publish -PcheckoutIfCloned -Prelease
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
- name: Github release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
LICENSE
build/libs/*.jar
30 changes: 30 additions & 0 deletions .github/workflows/release-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release Java CI

on:
push:
branches:
- main
- 'release/**'
pull_request:
branches:
- main
- 'release/**'
# Nightly builds to ensure dependencies don't break anything
schedule:
- cron: '0 0 * * *'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install Mcl Java bindings
run: |
chmod +x install_mcl.sh
./install_mcl.sh $JAVA_HOME/include
- name: Build with Gradle
run: ./gradlew build -PcheckoutIfCloned -Prelease
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![Build Status](https://github.com/cryptimeleon/mclwrap/workflows/Development%20Java%20CI/badge.svg)
![Build Status](https://github.com/cryptimeleon/mclwrap/workflows/Release%20Java%20CI/badge.svg)
# Mclwrap

Mclwrap provides a wrapper around the BN-254 bilinear group implemented in the [MCL library](https://github.com/herumi/mcl). As the bilinear groups implemented in the Cryptimeleon Math library are not particulary efficient, use of this wrapper is recommended for proper benchmarks.
Expand Down Expand Up @@ -31,6 +33,9 @@ It will compile the mcl library (version v1.26) as well as the Java bindings, an
As a prerequisite, you need to have the `libgmp-dev` package installed.
Additionally, you may have to make the script executable by executing `chmod +x install_mcl.sh` before execution.

The `install_mcl.sh` script takes the `include` path of your Java JVM as its only argument.
The path should be given without a trailing forward slash.

#### Windows

As prerequisites you need Visual Studio with C++ build tools and the Windows 10 SDK installed.
Expand Down
89 changes: 86 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'maven-publish'
id 'signing'
}

group 'org.cryptimeleon'
archivesBaseName = project.name
boolean isRelease = project.hasProperty("release")
version = '1.0.0' + (isRelease ? "" : "-SNAPSHOT")

description = """"""

sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
Expand Down Expand Up @@ -78,8 +76,93 @@ task javadocLink(type: Javadoc) {
}
}


task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}

task javadocJar(type: Jar, dependsOn: javadocLink) {
from javadoc.destinationDir
archiveClassifier = 'javadoc'
}

artifacts {
archives javadocJar
archives sourcesJar
}

java {
registerFeature("tests") {
usingSourceSet(sourceSets.test)
}
withJavadocJar()
withSourcesJar()
}


publishing {
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
artifacts {
archives javadocJar, sourcesJar
}

pom {
name = 'mclwrap'
url = 'https://cryptimeleon.org'
description = "Mclwrap provides a wrapper around the BN-254 bilinear group implemented in " +
"the MCL library. As the bilinear groups implemented in the Cryptimeleon Math library " +
"are not particulary efficient, use of this wrapper is recommended for proper benchmarks. " +
"Specifically, the Mclwrap implementation's group operations are roughly 100 times " +
"as fast as our own implementation."
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'cryptimeleon-dev'
name = 'cryptimeleon Developers'
email = 'dev@cryptimeleon.org'
}
}
scm {
connection = 'scm:git:git://github.com/cryptimeleon/mclwrap.git'
developerConnection = 'scm:git:https://github.com/cryptimeleon/mclwrap.git'
url = 'https://github.com/cryptimeleon/mclwrap/'
}
}
}
}
repositories {
maven {
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_TOKEN")
}
name = 'OSSRH'
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
url = version.endsWith('SNAPSHOT') ? '' : releasesRepoUrl
}
}
}

signing {
required(project.hasProperty("release"))
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
21 changes: 3 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,29 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
14 changes: 6 additions & 8 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,18 @@ if (!hasProperty("release")) {
+ "' exists remotely but not locally. Please check it out yourself before building.")
}
} else {
println(msgPrefix + libPrefix + ": Branch '" + branchThis.getName() + "' does not exist remotely. Using master.")
if (grgitLib.branch.current().getName() == "master") {
println(msgPrefix + libPrefix + ": Branch master is checked out already. Using it.")
println(msgPrefix + libPrefix + ": Branch '" + branchThis.getName() + "' does not exist remotely. Using develop.")
if (grgitLib.branch.current().getName() == "develop") {
println(msgPrefix + libPrefix + ": Branch develop is checked out already. Using it.")
} else {
if (hasProperty("checkoutIfCloned") && cloned) {
println(msgPrefix + libPrefix + ": Branch master is not checked out. "
println(msgPrefix + libPrefix + ": Branch develop is not checked out. "
+ "'checkoutIfCloned' is set. Automatically checking it out.")
grgitLib.checkout {
branch = branchThis.getName()
startPoint = "origin/" + branchThis.getName()
createBranch = true
branch = develop
}
} else {
throw new GradleException(msgPrefix + libPrefix + ": Branch master exists but is not checked out. "
throw new GradleException(msgPrefix + libPrefix + ": Branch develop exists but is not checked out. "
+ "Please check it out yourself before building.")
}
}
Expand Down

0 comments on commit dacbaa9

Please sign in to comment.