Skip to content

Commit

Permalink
Merge pull request #134 from /issues/121
Browse files Browse the repository at this point in the history
Issues/121
  • Loading branch information
AB3rtz authored Sep 14, 2022
2 parents 095514f + 52b2881 commit 23571d6
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 17 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/generate-jekyll-pages-for-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: generate-jekyll-pages-for-docs

on:
workflow_run:
workflows: [ update-gh-pages ]
branches: [ main ]
types: [ completed ]

jobs:
generate-jekyll-pages:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: gh-pages
fetch-depth: 0

- name: Generate pages from present docs folders and templates
run: bash ./generate-pages.sh
env:
MASTER_BRANCH_NAME: origin/main
SOURCE_INDEX_FILE: README.md

- name: Commit changes
uses: EndBug/[email protected]
31 changes: 18 additions & 13 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,30 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build
- name: Build with Gradle
run: ./gradlew build

publish-docs-reports:
needs: build
runs-on: ubuntu-latest

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

- name: Set up JDK 11
uses: actions/setup-java@v2
Expand All @@ -60,13 +61,15 @@ jobs:
clean: true
folder: build/reports/tests
target-folder: docs/latest/junit

- name: Deploy jacoco report to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
clean: true
folder: build/reports/jacoco
target-folder: docs/latest/jacoco

- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
Expand All @@ -82,13 +85,15 @@ jobs:
clean: true
folder: build/reports/tests
target-folder: docs/${{ env.PROJECT_VERSION }}/junit

- name: Deploy jacoco report to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
clean: true
folder: build/reports/jacoco
target-folder: docs/${{ env.PROJECT_VERSION }}/jacoco

- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# separate terms of service, privacy policy, and support
# documentation.

name: Publish package to GitHub Packages and Maven Central
name: Publish package to Maven Central
on:
release:
types: [created]
Expand All @@ -14,15 +14,21 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '8'
java-version: '11'
distribution: 'adopt'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Publish package
uses: gradle/gradle-build-action@v2
with:
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/update-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: update-gh-pages

on:
workflow_run:
workflows: [ Java CI with Gradle ]
types: [ completed ]
branches: [ main ]

jobs:
generate-docs-reports:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Export project version
run: echo "PROJECT_VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}')" >> $GITHUB_ENV

- name: Generate Javadoc
run: ./gradlew javadoc

- name: Run tests and generate reports
run: ./gradlew test

- name: Deploy site (javadocs) to GitHub Pages for current version
uses: JamesIves/[email protected]
with:
branch: gh-pages
clean: true
folder: build/docs/javadoc
target-folder: docs/${{ env.PROJECT_VERSION }}/javadoc

- name: Deploy tests results to GitHub Pages for current version
uses: JamesIves/[email protected]
with:
branch: gh-pages
clean: true
folder: build/reports/tests
target-folder: docs/${{ env.PROJECT_VERSION }}/junit

- name: Deploy jacoco report to GitHub Pages for current version
uses: JamesIves/[email protected]
with:
branch: gh-pages
clean: true
folder: build/reports/jacoco
target-folder: docs/${{ env.PROJECT_VERSION }}/jacoco

- name: Deploy site (javadocs) to GitHub Pages as latest version
uses: JamesIves/[email protected]
with:
branch: gh-pages
clean: true
folder: build/docs/javadoc
target-folder: docs/latest/javadoc

- name: Deploy tests results to GitHub Pages as latest version
uses: JamesIves/[email protected]
with:
branch: gh-pages
clean: true
folder: build/reports/tests
target-folder: docs/latest/junit

- name: Deploy jacoco report to GitHub Pages as latest version
uses: JamesIves/[email protected]
with:
branch: gh-pages
clean: true
folder: build/reports/jacoco
target-folder: docs/latest/jacoco

0 comments on commit 23571d6

Please sign in to comment.