Skip to content

Commit

Permalink
Upgrade to asciidoctor-epub3 2.0.1, Gradle 8.5, and release from GH (#18
Browse files Browse the repository at this point in the history
)

* Upgrade to asciidoctor-epub3 2.0.1, Gradle 8.5, and release from GH

* Remove duplicate line
  • Loading branch information
robertpanzer committed Jan 20, 2024
1 parent 0273b88 commit f6a767a
Show file tree
Hide file tree
Showing 11 changed files with 252 additions and 229 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

on: workflow_dispatch

env:
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEY_ID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSS_SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSS_SONATYPE_PASSWORD }}

jobs:
release:
environment: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Build
run: |
unset GEM_PATH GEM_HOME JRUBY_OPTS
./gradlew --no-daemon clean build
./gradlew --no-daemon publishToSonatype closeSonatypeStagingRepository
1 change: 1 addition & 0 deletions asciidoctorj-epub3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def gemFiles = fileTree("${project.buildDir}/.gems") {
include 'specifications/*'
include 'gems/*/lib/**'
include 'gems/*/data/**'
include 'gems/*/*'
}

jrubyPrepare {
Expand Down
2 changes: 1 addition & 1 deletion asciidoctorj-epub3/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
properName=AsciidoctorJ EPUB3
description=AsciidoctorJ EPUB3 bundles the Asciidoctor EPUB3 RubyGem (asciidoctor-epub3) so it can be loaded into the JVM using JRuby.
version=1.5.1
version=2.0.1
gem_name=asciidoctor-epub3
44 changes: 22 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
adding the plugin jars to the classpath to apply them later.
currently the new plugins DSL does apply them directly.
there are other limitations too. See https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block
we don't need to apply the jruby and bintray plugin on the rootProject.
we don't need to apply the jruby plugin on the rootProject.
*/
buildscript {
repositories {
Expand All @@ -17,24 +17,10 @@ buildscript {
// modern plugins config
plugins {
id "signing"
id "io.codearte.nexus-staging" version "0.22.0"
id "de.marcphilipp.nexus-publish" version "0.4.0"
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
id 'com.github.jruby-gradle.base' version '2.0.0'
}

apply plugin: 'io.codearte.nexus-staging'


nexusStaging {
if (project.hasProperty("sonatypeUsername")) {
username = project.sonatypeUsername
}
if (project.hasProperty("sonatypePassword")) {
password = project.sonatypePassword
}
repositoryDescription = "Release ${project.group} ${project.version}"
}

// TIP use -PpublishRelease=true to active release behavior regardless of the version
status = project.hasProperty('publishRelease') && project.publishRelease.toBoolean() ?
'release' : ((version == 'unspecified' || version.endsWith('-SNAPSHOT')) ? 'snapshot' : 'release')
Expand All @@ -50,14 +36,13 @@ ext {
commonsioVersion = '2.4'
guavaVersion = '18.0'
hamcrestVersion = '1.3'
jrubyVersion = '9.2.0.0'
junitVersion = '4.12'
jrubyJarVersion = '9.4.5.0'
junitVersion = '4.13.2'
saxonVersion = '9.5.1-6'
xmlMatchersVersion = '1.0-RC1'
pdfboxVersion = '1.8.10'

// gem versions
asciidoctorJVersion = project.hasProperty('asciidoctorJVersion') ? project.asciidoctorJVersion : '1.5.8.1'
asciidoctorJVersion = project.hasProperty('asciidoctorJVersion') ? project.asciidoctorJVersion : '2.5.11'
asciidoctorEpub3GemVersion = project.hasProperty('asciidoctorEpub3GemVersion') ? project.asciidoctorEpub3GemVersion : project(':asciidoctorj-epub3').version.replace('-', '.')

}
Expand Down Expand Up @@ -102,8 +87,8 @@ subprojects {
testImplementation "junit:junit:$junitVersion"
testImplementation "org.hamcrest:hamcrest-library:$hamcrestVersion"
testImplementation "org.jboss.arquillian.junit:arquillian-junit-container:$arquillianVersion"

}

apply plugin: 'codenarc'
codenarc {
configFile = rootProject.file('config/codenarc/codenarc.groovy')
Expand Down Expand Up @@ -170,7 +155,7 @@ configure(subprojects.findAll { it.name != 'itest'}) {
}

jruby {
jrubyVersion = jrubyVersion
jrubyVersion = jrubyJarVersion
}

ext {
Expand All @@ -191,3 +176,18 @@ configure(subprojects.findAll { it.name != 'itest'}) {
processResources.dependsOn jrubyPrepare

}

nexusPublishing {
repositories {
sonatype {
if (project.hasProperty("sonatypeUsername")) {
username = project.sonatypeUsername
}
if (project.hasProperty("sonatypePassword")) {
password = project.sonatypePassword
}
repositoryDescription = "Release ${project.group} ${project.version}"
}
}
clientTimeout = Duration.ofMinutes(5)
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=1.5.1
version=2.0.1
51 changes: 0 additions & 51 deletions gradle/deploy.gradle

This file was deleted.

30 changes: 11 additions & 19 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: 'de.marcphilipp.nexus-publish'
apply plugin: 'maven-publish'

publishing {
publications.create(project.ext.publicationName, MavenPublication) {
Expand Down Expand Up @@ -58,21 +58,20 @@ publishing {
}
}


// QUESTION should we move manifest creation to general Java plugin config?
jar {
manifest {
attributes \
'Built-By': System.properties['user.name'],
'Created-By': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})".toString(),
'Build-Date': buildDateOnly,
//'Build-Time': buildTimeOnly,
//'Specification-Title': project.name,
//'Specification-Version': project.version,
//'Specification-Vendor': 'asciidoctor.org',
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': 'asciidoctor.org'
'Built-By': System.properties['user.name'],
'Created-By': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})".toString(),
'Build-Date': buildDateOnly,
//'Build-Time': buildTimeOnly,
//'Specification-Title': project.name,
//'Specification-Version': project.version,
//'Specification-Vendor': 'asciidoctor.org',
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': 'asciidoctor.org'
}
}

Expand All @@ -87,10 +86,3 @@ publishing {
}
}
}

nexusPublishing {
repositories {
sonatype()
}
}

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.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit f6a767a

Please sign in to comment.