Skip to content

Commit

Permalink
ci: Publish to JFrog Artifactory (#5)
Browse files Browse the repository at this point in the history
Publish to JFrog Artifactory.
Change maven group id to org.hyperledger.besu
Change pre release version to 0.1.1

Signed-off-by: Usman Saleem <[email protected]>
  • Loading branch information
usmansaleem authored Mar 12, 2024
1 parent 4481be2 commit 42a9871
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ jobs:
- name: Publish to GitHub Packages
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to JFrog Artifactory
run: ./gradlew artifactoryPublish
env:
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_KEY: ${{ secrets.BESU_ARTIFACTORY }}
24 changes: 23 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'java-library'
id 'maven-publish'
alias libs.plugins.spotless
alias libs.plugins.artifactory
}

repositories {
Expand Down Expand Up @@ -99,7 +100,7 @@ spotless {
publishing {
publications {
library(MavenPublication) {
groupId = 'org.hyperledger.errorpronechecks'
groupId = 'org.hyperledger.besu'
from components.java
versionMapping {
usage('java-api') {
Expand Down Expand Up @@ -138,4 +139,25 @@ publishing {
}
}
}

def artifactoryUser = project.hasProperty('artifactoryUser') ? project.property('artifactoryUser') : System.getenv('ARTIFACTORY_USER')
def artifactoryKey = project.hasProperty('artifactoryApiKey') ? project.property('artifactoryApiKey') : System.getenv('ARTIFACTORY_KEY')
def artifactoryRepo = System.getenv('ARTIFACTORY_REPO') ?: 'besu-maven'
def artifactoryOrg = System.getenv('ARTIFACTORY_ORG') ?: 'hyperledger'

artifactory {
contextUrl = "https://hyperledger.jfrog.io/${artifactoryOrg}"
publish {
repository {
repoKey = artifactoryRepo
username = artifactoryUser
password = artifactoryKey
}
defaults {
publications('library')
publishArtifacts = true
publishPom = true
}
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.1.0
version=0.1.1

org.gradle.welcome=never

Expand Down
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ slf4j = "2.0.10"
picocli = "4.7.5"
jetbrain-annotations = "24.1.0"
spotless = "6.25.0"
artifactory = "5.2.0"

[libraries]
picocli = { module = "info.picocli:picocli", version.ref = "picocli" }
Expand All @@ -28,4 +29,5 @@ junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "jun
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj" }

[plugins]
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
artifactory = { id = "com.jfrog.artifactory", version.ref = "artifactory" }

0 comments on commit 42a9871

Please sign in to comment.