Skip to content

Commit

Permalink
Merge pull request #15 from UniVE-SSV/pipeline-changes
Browse files Browse the repository at this point in the history
Pipeline changes
  • Loading branch information
lucaneg committed Dec 21, 2020
2 parents 9cc2760 + c8f7cc9 commit 64a4753
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 4 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release publishing

on:
release:
types: [published]

jobs:
publish-release:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x lisa/gradlew
- name: Publish artifact
env:
SIGN_PW: ${{ secrets.SIGN_PASSPHRASE }}
SIGN_KEY: ${{ secrets.SIGN_PRIVATE_KEY }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cd lisa && ./gradlew publish
9 changes: 9 additions & 0 deletions lisa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ plugins {
// for visualizing them: https://www.planttext.com/
id 'com.github.roroche.plantuml' version '1.0.2'

// this can generate images from plantuml files
// it requires graphviz to be installed
id "org.fmiw.plantuml" version "0.1"

// parse git information during the build
id 'org.ajoberstar.grgit' version '4.0.2'

Expand All @@ -42,6 +46,10 @@ plugins {

// this enables './gradlew <task> taskTree' to show task dependencies
id "com.dorongold.task-tree" version "1.5"

// publication on maven central
id 'maven-publish'
id 'signing'
}

// the code reading data from the git repo has to be placed in the same file where its
Expand Down Expand Up @@ -82,3 +90,4 @@ apply from: 'java.gradle'
apply from: 'code-style.gradle'
apply from: 'doc-extra.gradle'
apply from: 'antlr.gradle'
apply from: 'publishing.gradle'
48 changes: 44 additions & 4 deletions lisa/doc-extra.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,51 @@
classDiagram {
packageName = "it.unive.lisa"
outputFile = new File("${projectDir}/diagrams/class_diagram.plantuml")
}
import org.gradle.api.internal.tasks.userinput.UserInputHandler;

buildClassDiagram {
doFirst {
mkdir new File("${projectDir}/diagrams/")
def handler = services.get(UserInputHandler)
def pkg = handler.askQuestion('> Target package (will be appended to \'it.unive.lisa.\'): ', '')
if (pkg && !pkg.allWhitespace)
pkg = '.' + pkg
def fname = handler.askQuestion('> File name (will be under the \'diagrams\' folder with \'.plantuml\' extension): ', 'class_diagram')
classDiagram.packageName = "it.unive.lisa" + pkg
classDiagram.outputFile = new File("${projectDir}/diagrams/" + fname + ".plantuml")
}
}

plantuml {
options {
outputDir = new File("${projectDir}/diagrams/")
format = 'png'
}

diagrams {
uml {
sourceFile = new File('build.gradle')
}
}
}

def target
generateDiagramUml {
outputs.upToDateWhen { false }

doFirst {
mkdir new File("${projectDir}/diagrams/")
def handler = services.get(UserInputHandler)
target = handler.askQuestion('> Filename (without the plantuml extension) to convert: ', '')
def file = new File("${projectDir}/diagrams/" + target + ".plantuml")
plantuml.diagrams.uml.sourceFile = file
}

doLast {
copy {
from "${projectDir}/diagrams/"
include 'uml.png'
into "${projectDir}/diagrams/"
rename 'uml.png', target + ".png"
}
delete "${projectDir}/diagrams/uml.png"
}
}

Expand Down
6 changes: 6 additions & 0 deletions lisa/java.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,10 @@ plugins.withType(JavaPlugin) {
java {
withJavadocJar()
withSourcesJar()
}

javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
77 changes: 77 additions & 0 deletions lisa/publishing.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'lisa'
groupId = 'com.github.unive-ssv'
from components.java
pom {
name = 'LiSA'
description = 'A library for static analysis'
url = 'https://unive-ssv.github.io/lisa/'
packaging = 'jar'
licenses {
license {
name = 'MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id = 'lucaneg'
name = 'Luca Negrini'
email = 'luca.negrini@unive.it'
url = 'https://lucaneg.github.io/'
organization = 'Ca\' Foscari University of Venice, Italy'
organizationUrl = 'https://www.unive.it/'
}
developer {
id = 'VincenzoArceri'
name = 'Vincenzo Arceri'
email = 'vincenzo.arceri@unive.it'
url = 'https://vincenzoarceri.github.io/'
organization = 'Ca\' Foscari University of Venice, Italy'
organizationUrl = 'https://www.unive.it/'
}
developer {
id = 'pietroferrara'
name = 'Pietro Ferrara'
email = 'pietro.ferrara@unive.it'
url = 'https://www.dais.unive.it/~ferrara/'
organization = 'Ca\' Foscari University of Venice, Italy'
organizationUrl = 'https://www.unive.it/'
}
}
scm {
connection = 'scm:git:git://github.com/UniVE-SSV/lisa.git'
developerConnection = 'scm:git:ssh://github.com/UniVE-SSV/lisa.git'
url = 'https://github.com/UniVE-SSV/lisa'
}
}
}
}
repositories {
maven {
name = "OSSRH"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/UniVE-SSV/lisa"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

signing {
def signingKey = System.getenv("SIGN_KEY")
def signingPassword = System.getenv("SIGN_PW")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}

0 comments on commit 64a4753

Please sign in to comment.