Skip to content
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
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish package to GitHub Packages
on:
pull_request:
types: [opened, synchronize]
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- id: github-app-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.JSONPATHCOMPILER_GITHUB_APP_APP_ID }}
private_key: ${{ secrets.JSONPATHCOMPILER_GITHUB_APP_PRIVATE_KEY }}
- name: Publish package
uses: gradle/gradle-build-action@v2
with:
arguments: publish
env:
GITHUB_TOKEN: ${{ steps.github-app-token.outputs.token }}
44 changes: 11 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
plugins {
id "com.jfrog.bintray" version "1.7"
id "maven-publish"
id "java"
id "jacoco"
Expand All @@ -11,7 +10,6 @@ plugins {

repositories {
mavenCentral()
jcenter()
}

configurations {
Expand Down Expand Up @@ -81,8 +79,18 @@ allprojects {
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/medjed/JsonPathCompiler"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
mavenPublication(MavenPublication) {
gpr(MavenPublication) {
from components.java
groupId project.group
artifactId project.name
Expand Down Expand Up @@ -114,35 +122,6 @@ allprojects {
}
}
}

bintray {
user = project.hasProperty('bintray_user') ? bintray_user : ''
key = project.hasProperty('bintray_apikey') ? bintray_apikey : ''
publish = true // automatic publish

pkg {
userOrg = 'medjed'
repo = 'maven'
name = project.name
licenses = [project.license]
websiteUrl = project.websiteUrl
issueTrackerUrl = project.issueTrackerUrl
vcsUrl = project.vcsUrl
githubRepo = project.githubRepo
version {
name = project.version
released = new Date()
gpg {
sign = true
passphrase = project.hasProperty('bintray_gpg_password') ? bintray_gpg_password : ''
}
}
}
publications = ['mavenPublication']
configurations = ['archives']

// dryRun = true
}
}

task classpath(type: Copy, dependsOn: ["jar"]) {
Expand All @@ -166,6 +145,5 @@ task(commitJavadoc, dependsOn: generateJavadoc) << {
}

afterReleaseBuild.dependsOn commitJavadoc
afterReleaseBuild.dependsOn bintrayUpload

clean { delete "classpath" }