Skip to content

Commit

Permalink
Move from GPR to Bintray
Browse files Browse the repository at this point in the history
  • Loading branch information
mkondratek committed Aug 11, 2020
1 parent 893a36a commit af731fb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ jobs:
- name: Build with Gradle
run: gradle build

# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# The ORG_GRADLE_PROJECT_bintrayUser and ORG_GRADLE_PROJECT_bintrayKey
# need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish to GitHub Packages
run: gradle publish
- name: Upload to Bintray
run: gradle bintrayUpload
env:
ORG_GRADLE_PROJECT_githubUsername: ${{ secrets.GRADLE_PUBLISH_USER }}
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.GRADLE_PUBLISH_TOKEN }}
ORG_GRADLE_PROJECT_bintrayUser: ${{ secrets.BINTRAY_USER }}
ORG_GRADLE_PROJECT_bintrayKey: ${{ secrets.BINTRAY_KEY }}
30 changes: 17 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
kotlin("jvm") apply false
id("java")
id("maven-publish")
id("com.jfrog.bintray")
}


Expand Down Expand Up @@ -59,22 +60,25 @@ tasks.whenTaskAdded {
}
}

val githubToken: String? by project
val githubUsername: String? by project
val bintrayKey: String? by project

bintray {
user = "kromanowski"
key = project.findProperty("bintray_api_key") as String? ?: bintrayKey
setPublications("MavenJava")
publish = true
pkg(delegateClosureOf<com.jfrog.bintray.gradle.BintrayExtension.PackageConfig> {
repo = "releases"
userOrg = "romanowski"
name = project.name
setLicenses("Apache-2.0")
vcsUrl = "https://github.com/VirtusLab/dokka-site.git"
})
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/VirtusLab/dokka-site")
credentials {
username = project.findProperty("gpr.user") as String? ?: githubUsername
password = project.findProperty("gpr.key") as String? ?: githubToken
}
}
}
publications {
register("gpr", MavenPublication::class) {
register<MavenPublication>("MavenJava") {
from(components["java"])
}
}
Expand Down

0 comments on commit af731fb

Please sign in to comment.