Skip to content

Commit

Permalink
Merge pull request #1 from JabRef/updateProjectForPublishing
Browse files Browse the repository at this point in the history
Update project for publishing
  • Loading branch information
Siedlerchr authored Jul 22, 2024
2 parents 13ca423 + 5d2c8d1 commit 0a19fe5
Show file tree
Hide file tree
Showing 16 changed files with 159 additions and 184 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ (github.actor == 'dependabot[bot]') }}
steps:
- name: Merge PR
run: gh pr merge --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
17 changes: 0 additions & 17 deletions .github/workflows/build.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check

on: [ push, pull_request ]

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

- name: Build
run: ./gradlew build
18 changes: 11 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,32 @@ name: Publish

on:
push:
branches: [ main ]
branches: [ main, hotfix , testRelease]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 14.0.1
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

- name: Build
run: ./gradlew build

- name: Publish to Sonatype (for snapshots) or to Maven Central and Github Repository (for releases)
- name: Publish to Sonatype (for snapshots) or to Maven Central
run: ./gradlew publish closeAndReleaseRepository
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/update-gradle-wrapper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Update Gradle Wrapper

on:
schedule:
- cron: "0 5 * * 1"
workflow_dispatch:

jobs:
update-gradle-wrapper:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: Update Gradle Wrapper
uses: gradle-update/update-gradle-wrapper-action@v1
with:
labels: dependencies
repo-token: ${{ secrets.GH_TOKEN_UPDATE_GRADLE_WRAPPER }}
47 changes: 0 additions & 47 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

20 changes: 0 additions & 20 deletions .idea/jarRepositories.xml

This file was deleted.

15 changes: 0 additions & 15 deletions .idea/misc.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

77 changes: 40 additions & 37 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,24 @@ plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'org.openjfx.javafxplugin' version '0.0.13'
id 'org.hibernate.build.maven-repo-auth' version '3.0.3'
id 'org.openjfx.javafxplugin' version '0.1.0'
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
id 'org.javamodularity.moduleplugin' version '1.8.15'
id 'io.codearte.nexus-staging' version '0.30.0'
}

repositories {
jcenter()
}

group = 'com.tobiasdiez'
group = 'org.jabref'
version = '2.2.1-SNAPSHOT'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_9
// Ensure Java 8 compatibility while providing proper module description
// See https://github.com/java9-modularity/gradle-modules-plugin#separate-compilation-of-module-infojava
//modularity.mixedJavaRelease 8
//modularity.standardJavaRelease 9
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

apply plugin: 'java'

repositories {
mavenCentral()
}

dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.3'
Expand All @@ -32,9 +30,12 @@ java {
withJavadocJar()
withSourcesJar()
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}

javafx {
version = "19"
version = "20"
modules = ['javafx.base']
}

Expand All @@ -55,7 +56,19 @@ publishing {
distribution = 'repo'
}
}


developers {
developer {
id = 'siedlerchr'
name = 'Christoph Schwentker'
}

developer {
id = 'koppor'
name = 'Oliver Kopp'
}

developer {
id = 'tobiasdiez'
name = 'Tobias Diez'
Expand All @@ -65,20 +78,9 @@ publishing {
}
}
scm {
url = 'https://github.com/tobiasdiez/EasyBind'
connection = 'scm:git:git://github.com/tobiasdiez/EasyBind.git'
developerConnection = 'scm:git:[email protected]/tobiasdiez/EasyBind.git'
}
}

// Remove os-specific 'classifier' in pom for JavaFX dependency
// Taken from https://github.com/TestFX/Monocle/issues/64#issuecomment-489215444
pom.withXml {
Node pomNode = asNode()
pomNode.dependencies.'*'.findAll() {
it.groupId.text() == 'org.openjfx'
}.each {
it.remove(it.classifier)
url = 'https://github.com/JabRef/EasyBind'
connection = 'scm:git:git://github.com/JabRef/EasyBind.git'
developerConnection = 'scm:git:[email protected]/JabRef/EasyBind.git'
}
}
}
Expand Down Expand Up @@ -113,16 +115,17 @@ signing {
useInMemoryPgpKeys(System.getenv("SIGNING_KEY"), System.getenv("SIGNING_PASSWORD"))
sign publishing.publications.mavenJava
}

nexusStaging {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
nexusPublishing {
repositories {
sonatype { //only for users registered in Sonatype after 24 Feb 2021
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}

// Don't publish snapshots to Maven Central
closeAndReleaseRepository.onlyIf { isReleaseVersion }
closeRepository.onlyIf { isReleaseVersion }
releaseRepository.onlyIf { isReleaseVersion }

test {
useJUnitPlatform()
Expand All @@ -144,7 +147,7 @@ compileTestJava {
}
*/

tasks.withType(Javadoc) {
tasks.withType(Javadoc).configureEach {
// Ignore warnings because of missing elements
options.addStringOption('Xdoclint:all,-missing', '-quiet')
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 0a19fe5

Please sign in to comment.