Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submit to ossrh #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
16 changes: 0 additions & 16 deletions .github/workflows/bintray.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/ossrh-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
on:
push:
tags:
- '*'

jobs:
publish-ossrh:
runs-on: ubuntu-latest
environment: build-and-release-ossrh
steps:
- name: Checkout code
uses: actions/checkout@v2
- run: gradle publish
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
70 changes: 36 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ buildscript {
repositories {
jcenter()
}

dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1+"
}
}

plugins {
Expand All @@ -27,11 +23,10 @@ def natsVersion = "2.1.9"

allprojects {
apply plugin: 'java'
//apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'signing'

group 'org.cryptocurrency-testing'
group 'com.github.cryptocurrency-testing'
version = "$natsVersion"
archivesBaseName = "embedded-nats-binaries"
sourceCompatibility = 1.6
Expand Down Expand Up @@ -84,6 +79,9 @@ project(':nats-artifacts') {
}

subprojects {
apply plugin: "maven-publish"
apply plugin: "signing"

task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
classifier = 'sources'
Expand All @@ -95,6 +93,17 @@ subprojects {
}

publishing {
repositories {
maven {
name = "OSSRH"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"

credentials {
username = project.hasProperty('maven.username') ? project.property('maven.username') : System.getenv('MAVEN_USERNAME')
password = project.hasProperty('maven.password') ? project.property('maven.password') : System.getenv('MAVEN_PASSWORD')
}
}
}
publications {
configurations.bundles.artifacts.all { archive ->
def publicationName = archive.archiveTask.name - 'Jar'
Expand All @@ -108,10 +117,24 @@ subprojects {
}
}
}
signing {
sign publishing.publications
}
}
}

publishing {
repositories {
maven {
name = "OSSRH"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"

credentials {
username = project.hasProperty('maven.username') ? project.property('maven.username') : System.getenv('MAVEN_USERNAME')
password = project.hasProperty('maven.password') ? project.property('maven.password') : System.getenv('MAVEN_PASSWORD')
}
}
}
publications {
bom(MavenPublication) {
artifactId 'embedded-nats-binaries-bom'
Expand Down Expand Up @@ -144,31 +167,10 @@ publishing {
}
}
}

signing {
sign publishing.publications
}
allprojects {

bintray {
user = project.hasProperty('bintray.user') ? project.property('bintray.user') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintray.apiKey') ? project.property('bintray.apiKey') : System.getenv('BINTRAY_API_KEY')
publications = project.publishing.publications.findAll().collect { it.name }
publish = true
pkg {
repo = 'embedded-nats-binaries'
userOrg = 'cryptocurrency-testing'
name = 'embedded-nats-binaries'
desc = 'Embedded NATS binaries for tests'
licenses = ['MIT']
vcsUrl = 'https://github.com/cryptocurrency-testing/embedded-nats-binaries.git'
version {
name = project.version
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = project.hasProperty('bintray.pgpPassphrase') ? project.property('bintray.pgpPassphrase') : System.getenv('BINTRAY_PGP_PASSPHRASE')
}
}
}
}

task install(group: 'publishing') {}

configurations.bundles.artifacts.all { archive ->
Expand All @@ -179,9 +181,9 @@ allprojects {
install.dependsOn "publish${publicationName.capitalize()}PublicationToMavenLocal"
}

task uploadArchives(group: 'publishing') {
dependsOn bintrayUpload
}
// task uploadArchives(group: 'publishing') {
// dependsOn bintrayUpload
// }

tasks.whenTaskAdded { task ->
if (task.name == 'publishBomPublicationToMavenLocal') {
Expand Down