Skip to content

Commit

Permalink
Fix gh-pages docs publication (asciidoctor#719)
Browse files Browse the repository at this point in the history
* CI:
  * Set write permissions
  * Update active branches
  * Use GH Actions token
* gh-pages Gradle script
  * Update active branches
  * Inject repo from CI env var
  * Disable antora module: using it breaks git-publish
* Update .sdkmanrc to Java 11
* Some documents fixes
  • Loading branch information
abelsromero authored and tylerbertrand committed Apr 12, 2024
1 parent 0e03283 commit 084c5f9
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 26 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
9 changes: 5 additions & 4 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 All @@ -20,7 +20,7 @@ Andres Almiray <https://github.com/aalmiray[@aalmiray]>
:plugin-name: Asciidoctor Gradle plugin
:project-name: asciidoctor-gradle-plugin
:project-full-path: asciidoctor/asciidoctor-gradle-plugin
:github-branch: development-4.x
:github-branch: master
:linkattrs:
ifndef::env-github[:icons: font]
ifdef::env-github,env-browser[]
Expand All @@ -44,10 +44,11 @@ endif::[]

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

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}
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 current 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 084c5f9

Please sign in to comment.