Initial package publish

This commit is contained in:
Justin Abrahms 2022-04-28 21:09:27 -07:00
parent f043020b45
commit b9e02411bf
3 changed files with 49 additions and 23 deletions

View File

@ -39,8 +39,9 @@ jobs:
- name: Publish to GitHub Packages
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
with:
arguments: publish
arguments: publish -PossrhUsername=${{ secrets.OSSRH_USERNAME }}
env:
release=1
REPOSITORY_URL: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
USERNAME: ${{ secrets.OSSRH_USERNAME }}
TOKEN: ${{ secrets.OSSRH_PASSWORD }}

View File

@ -42,7 +42,6 @@ jobs:
with:
arguments: publish
env:
snapshot: 1
REPOSITORY_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/
USERNAME: ${{ secrets.OSSRH_USERNAME }}
TOKEN: ${{ secrets.OSSRH_PASSWORD }}

View File

@ -12,10 +12,9 @@ plugins {
id "io.freefair.lombok" version "6.4.3"
id 'pmd'
id 'maven-publish'
id 'signing'
}
group = 'dev.open-feature'
pmd {
pmdTest.enabled = false
}
@ -44,29 +43,56 @@ tasks.named('test') {
useJUnitPlatform()
}
String repository_url = System.getenv("REPOSITORY_URL")
String username = System.getenv("USERNAME")
String password = System.getenv("TOKEN")
if (repository_url && username && password) {
def repo_url = System.getenv("REPOSITORY_URL")
publishing {
repositories {
maven {
name = "OSSRH"
url = uri(repository_url)
credentials {
username = username
password = password
group = 'dev.openfeature'
version = '0.0.1' + (Boolean.valueOf(System.getProperty("release")) ? "" : "-SNAPSHOT")
publishing {
publications {
maven(MavenPublication) {
artifactId="javasdk"
from components.java
pom {
name = 'OpenFeature SDK'
packaging = 'jar'
// optionally artifactId can be defined here
description 'A library to abstract feature flagging across many providers'
url = 'https://openfeature.dev'
scm {
connection = 'scm:git:https://github.com/openfeature/javasdk.git'
developerConnection = 'scm:git:https://github.com/openfeature/javasdk.git'
url = 'https://github.com/openfeature/javasdk'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'abrahms'
name = 'Justin Abrahms'
email = 'jabrahms@ebay.com'
}
}
}
}
publications {
gpr(MavenPublication) {
artifactId = 'javasdk'
version = '0.0.1' + (Boolean.valueOf(System.getProperty("snapshot")) ? "-SNAPSHOT" : "")
from(components.java)
}
}
}
repositories {
maven {
credentials {
username = ossrhUsername
password = ossrhPassword
}
url = repo_url
}
}
}