Skip to content

Commit

Permalink
chore: added github actions release workflow (#108) (#109)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency gradle to v6.2.0 (#107)

Co-authored-by: WhiteSource Renovate <[email protected]>

* chore: github actions publish release workflow

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: WhiteSource Renovate <[email protected]>

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: WhiteSource Renovate <[email protected]>
  • Loading branch information
3 people authored Feb 18, 2020
1 parent 69e79b2 commit 6c85a37
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 118 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Release

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Build with Gradle
run: gradle build

- name: Publish to GitHub Packages
run: gradle publish
env:
USERNAME: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}

174 changes: 56 additions & 118 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,130 +1,45 @@
buildscript {
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.27.1"
}
}

plugins {
id 'java'
id 'maven'
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'com.diffplug.gradle.spotless' version '3.27.1'
}

apply plugin:'java'
apply plugin:'maven'
apply plugin:'maven-publish'
apply plugin: com.diffplug.gradle.spotless.SpotlessPlugin

repositories {
jcenter()
mavenCentral()
}

task fatJar(type: Jar) {
manifest.from jar.manifest
classifier = 'standalone'
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
with jar
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

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

artifacts {
archives javadocJar, sourcesJar
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "file://${buildDir}/repo") {}

//repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
// authentication(userName: '', password: '')
// }

// snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
// authentication(userName: ossrhUsername, password: ossrhPassword)
// }

pom.project {
groupId = 'org.arkecosystem'
version = '1.0.0'
artifactId = 'crypto'

name = 'java-crypto'
description = 'A simple Cryptography Implementation in Java for the Ark Blockchain.'
url = 'https://github.com/ArkEcosystem/java-crypto'
inceptionYear = '2018'

licenses {
license {
name = 'MIT'
distribution = 'repo'
}
}

developers {
developer {
name = 'Brian Faust'
email = '[email protected]'
organization = 'Ark Ecosystem'
organizationUrl = 'https://ark.io'
}
developer {
name = 'Joshua Noack'
email = '[email protected]'
organization = 'Ark Ecosystem'
organizationUrl = 'https://ark.io'
}
developer {
name = 'Kristjan Kosic'
email = '[email protected]'
organization = 'Ark Ecosystem'
organizationUrl = 'https://ark.io'
}
developer {
name = 'Zan Kovac'
email = '[email protected]'
organization = 'Ark Ecosystem'
organizationUrl = 'https://ark.io'
}
}

scm {
connection = 'scm:git:git://github.com/ArkEcosystem/java-crypto.git'
developerConnection = 'scm:git:ssh://github.com:ArkEcosystem/java-crypto.git'
url = 'https://github.com/ArkEcosystem/java-crypto/tree/1.0.0'
group = 'org.arkecosystem'
version = '1.0.1'

publishing {
publishing {
repositories {
maven {
name = "github"
url = uri("https://maven.pkg.github.com/arkecosystem/java-crypto")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("PASSWORD")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}
}

if (project.hasProperty("signing.keyId")) {
apply plugin: 'signing'
signing {
sign configurations.archives
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
}


dependencies {
compile group: 'org.bitcoinj', name: 'bitcoinj-core', version: '0.15.6'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
Expand All @@ -150,20 +65,43 @@ jacocoTestReport {
}

wrapper {
gradleVersion = '5.6.2'
gradleVersion = '6.2.0'
}
spotless {
java {
target fileTree(projectDir) {
include 'src/main/**/*.java'
include 'src/test/**/*.java'
exclude '**/build/**'
}
googleJavaFormat('1.1').aosp()

spotless {
java {
target fileTree(projectDir) {
include 'src/main/**/*.java'
include 'src/test/**/*.java'
exclude '**/build/**'
}
googleJavaFormat('1.1').aosp()
}

}

task formatCode(dependsOn: ['spotlessApply'])

task fatJar(type: Jar) {
manifest.from jar.manifest
classifier = 'standalone'
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
with jar
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

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

build.dependsOn 'spotlessApply'

0 comments on commit 6c85a37

Please sign in to comment.