Skip to content

Commit

Permalink
Fix gh-pages docs publication
Browse files Browse the repository at this point in the history
Found an issue where enabling 'antora' sub-modules causes commits with
git-publish to be empty. For now simply remove antora module.
* CI:
  * Set write permissions
  * Update active branches
  * Use GH Actions token
* gh-pages Gradle script
  * Update active branches
  * Inject repo from CI env var
* Update .sdkmanrc to Java 11
* Some documents fixes
  • Loading branch information
abelsromero committed Feb 27, 2024
1 parent b99ef7b commit b1c2d65
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 24 deletions.
File renamed without changes.
17 changes: 10 additions & 7 deletions .github/workflows/push-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ on:
push:
branches:
- master
- development-4.x
permissions:
contents: write
jobs:
check:
push-docs:
runs-on: ubuntu-latest
if: github.repository == 'asciidoctor/asciidoctor-gradle-plugin'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: zulu
- uses: gradle/gradle-build-action@v2
distribution: temurin
- uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
- name: Combine documentation
Expand All @@ -23,9 +26,9 @@ jobs:
- name: Publish documentation
env:
CI_BRANCH: ${{ github.ref_name }}
REPO_URL: ${{ github.server_url }}/${{ github.repository }}
GRGIT_USER: 'GH Action User'
GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }}
run: |
cd docs
./gradlew --console=plain --info :antora:publishDocs :gh-pages:publishDocs \
-Dorg.ajoberstar.grgit.auth.username=${{ secrets.GITHUB_PUBLISH_USER }} \
-Dorg.ajoberstar.grgit.auth.password=${{ secrets.GITHUB_PUBLISH_KEY }} \
-Dorg.ajoberstar.grgit.auth.force=hardcoded
./gradlew --console=plain :gh-pages:publishDocs --info --stacktrace
4 changes: 2 additions & 2 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Enable auto-env through the sdkman_auto_env config
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=8.0.302-open
java=11.0.22-tem
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Andres Almiray <https://github.com/aalmiray[@aalmiray]>
:version-published: 4.0.0-alpha.1
:asciidoc-url: http://asciidoc.org
:asciidoctor-url: http://asciidoctor.org
:issues: https://github.com/asciidoctor/asciidoctor-maven-plugin/issues
:issues: https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues
:gradle-url: http://gradle.org/
:asciidoctor-maven-plugin: https://github.com/asciidoctor/asciidoctor-maven-plugin
:kotlindsl: https://github.com/gradle/kotlin-dsl[Gradle Kotlin DSL]
Expand Down Expand Up @@ -47,7 +47,7 @@ The {doctitle} is the official means of using {asciidoctor-url}[Asciidoctor] to
Documentation:: We are migrating our documentation to the new Asciidoctor Antora-based site when it is ready. In the meantime you can read a snapshot of the new documentation at {asciidoctor-development-docs}{github-branch}

ifdef::env-github[]
Structure:: `master` now represents the code for the latest 3.x release of these plugins.
Structure:: `master` now represents the code for the latest 4.x release of these plugins.
Development for 4.x is against the link:https://github.com/asciidoctor/asciidoctor-gradle-plugin/tree/development-4.x[{github-branch}] branch.
PRs are preferably taking against this branch.
The 3.x series of the plugin is now in maintenance only mode.
Expand Down
2 changes: 1 addition & 1 deletion docs/antora/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

ext {
currentBranch = System.getenv('CI_BRANCH') ?: 'not-on-ci'
pushDocs = currentBranch.matches(~/^(master|development-3.x|maintenance-1.5|maintenance-1.6)$/)
pushDocs = currentBranch.matches(~/^master|development-.+|maintenance-.+$/)
}

gitPublish {
Expand Down
4 changes: 1 addition & 3 deletions docs/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
id 'idea'
id 'org.asciidoctor.jvm.convert' apply false
id 'org.asciidoctor.editorconfig' apply false
id 'org.ajoberstar.git-publish' version '4.2.1' apply false
id 'org.ajoberstar.git-publish' version '4.2.2' apply false
}

repositories {
Expand Down
5 changes: 3 additions & 2 deletions docs/gh-pages/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id 'base'
id 'org.ajoberstar.git-publish'
}

Expand All @@ -8,8 +9,8 @@ ext {
}

gitPublish {
repoUri = gitHubRepoUri
branch = pagesBranch
repoUri = System.getenv('REPO_URL') ?: gitHubRepoUri
branch = 'gh-pages'

contents {
into currentBranch
Expand Down
4 changes: 1 addition & 3 deletions docs/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
antoraBranch=antora-pages
pagesBranch=gh-pages
gitHubRepoUri=https://github.com/asciidoctor/asciidoctor-gradle-plugin.git
gitHubRepoUri=https://github.com/asciidoctor/asciidoctor-gradle-plugin.git
5 changes: 3 additions & 2 deletions docs/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
rootProject.name='asciidoctor-gradle-docs'

includeBuild('..')
include 'antora'
include 'gh-pages'
include 'gh-pages'
// Removes antora, causes issue with gh-pages and git-publish plugin. Causing commits to delete files.
// include 'antora'
4 changes: 3 additions & 1 deletion docs/src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ endif::[]

The {doctitle} is the official means of using {asciidoctor-url}[Asciidoctor] to convert all your {asciidoc-url}[AsciiDoc] documentation using {gradle-url}[Gradle].

This started as a port of the {asciidoctor-maven-plugin} project founded by {lightguard} and relies on {asciidoctorj}[{asciidoctorj-name}] which was founded by {lordofthejars}. In fact the 1.5.x series of the {plugin-name} can still be considered a port. However with 2.x series came a complete departure with functionality far exceeding any lightweight markup plugins for any other build tool. With the 3.x serious allows for even more flexibility and options for the creation of a true DocuOps pipeline by bringing together Gradle as a powerful and generic build tool, and Asciidoctor as an agile and lightweight document generator.
This started as a port of the {asciidoctor-maven-plugin} project founded by {lightguard} and relies on {asciidoctorj}[{asciidoctorj-name}] which was founded by {lordofthejars}.
In fact the 1.5.x series of the {plugin-name} can still be considered a port. However, with 2.x series came a complete departure with functionality far exceeding any lightweight markup plugins for any other build tool.
With the 3.x serious allows for even more flexibility and options for the creation of a true DocuOps pipeline by bringing together Gradle as a powerful and generic build tool, and Asciidoctor as an agile and lightweight document generator.

include::parts/compatibility.adoc[]

Expand Down
3 changes: 2 additions & 1 deletion docs/src/docs/asciidoc/parts/compatibility.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
== Compatibility

This collection of plugins requires at least Gradle 4.9, JDK 8.0 and AsciidoctorJ 2.0.0 to run. If you need prior Gradle, JDK or {asciidoctorj-name} support please use a plugin from the 1.5.x or 1.6.x release series.
This collection of plugins requires at least Gradle 4.9, JDK 11.0 and AsciidoctorJ 2.0.0 to run.
If you need prior Gradle, JDK or {asciidoctorj-name} support please use a plugin from the 1.5.x or 1.6.x release series.

0 comments on commit b1c2d65

Please sign in to comment.