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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/pub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Maven 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 }}
88 changes: 72 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'maven-publish'
id 'signing'
}

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

description = """"""
description = 'The Math library provides the mathematical foundation for the other Cryptimeleon libraries. ' +
'It provides basics such as mathematical groups, rings and fields, e.g. Z_n , ' +
'as well as implementations of cryptographic pairings.'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -18,12 +22,9 @@ tasks.withType(JavaCompile) {


repositories {
jcenter()
mavenCentral()
mavenLocal()
maven { url "https://nexus.cs.upb.de/repository/sfb901-libs/" }
maven { url "https://nexus.cs.upb.de/repository/sfb901-releases/" }
maven { url "https://nexus.cs.upb.de/repository/sfb901-snapshots/" }
mavenCentral()
jcenter()
}

dependencies {
Expand Down Expand Up @@ -93,27 +94,82 @@ java {
registerFeature("tests") {
usingSourceSet(sourceSets.test)
}
withJavadocJar()
withSourcesJar()
}


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

pom {
name = 'Math'
url = 'https://cryptimeleon.org'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'jbobolz'
name = 'Jan Bobolz'
email = 'mail@jan-bobolz.de'
organization = 'Paderborn University'
}
developer {
id = 'feidens'
name = 'Fabian Eidens'
email = 'fabianeidens@gmail.com'
organization = 'Paderborn University'
url = 'https://feidens.github.io/'
}
developer {
id = 'rheitjoh'
name = 'Raphael Heitjohann'
email = 'rheitjoh@mail.uni-paderborn.de'
organization = 'Paderborn University'
}
}
scm {
connection = 'scm:git:git://github.com/cryptimeleon/math.git'
developerConnection = 'scm:git:https://github.com/cryptimeleon/math.git'
url = 'https://github.com/cryptimeleon/math/'
}
}
}
}

repositories {
maven {
credentials {
username = System.getProperty('nexus.user')
password = System.getProperty('nexus.key')
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_TOKEN")
}
def releasesRepoUrl = "https://nexus.cs.upb.de/repository/sfb901-releases/"
def snapshotsRepoUrl = "https://nexus.cs.upb.de/repository/sfb901-snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
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
}