diff --git a/.github/workflows/generate-jekyll-pages-for-docs.yml b/.github/workflows/generate-jekyll-pages-for-docs.yml new file mode 100644 index 000000000..18d4e4815 --- /dev/null +++ b/.github/workflows/generate-jekyll-pages-for-docs.yml @@ -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/add-and-commit@v8.0.1 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 89847b470..599d0ed4a 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -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 @@ -60,6 +61,7 @@ jobs: clean: true folder: build/reports/tests target-folder: docs/latest/junit + - name: Deploy jacoco report to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4.2.2 with: @@ -67,6 +69,7 @@ jobs: clean: true folder: build/reports/jacoco target-folder: docs/latest/jacoco + - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4.2.2 with: @@ -82,6 +85,7 @@ jobs: clean: true folder: build/reports/tests target-folder: docs/${{ env.PROJECT_VERSION }}/junit + - name: Deploy jacoco report to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4.2.2 with: @@ -89,6 +93,7 @@ jobs: clean: true folder: build/reports/jacoco target-folder: docs/${{ env.PROJECT_VERSION }}/jacoco + - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4.2.2 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 46675f9ad..9e69ec860 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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] @@ -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: diff --git a/.github/workflows/update-gh-pages.yml b/.github/workflows/update-gh-pages.yml new file mode 100644 index 000000000..159d4bfb3 --- /dev/null +++ b/.github/workflows/update-gh-pages.yml @@ -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/github-pages-deploy-action@v4.2.5 + 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/github-pages-deploy-action@v4.2.2 + 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/github-pages-deploy-action@v4.2.2 + 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/github-pages-deploy-action@v4.2.2 + 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/github-pages-deploy-action@v4.2.2 + 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/github-pages-deploy-action@v4.2.2 + with: + branch: gh-pages + clean: true + folder: build/reports/jacoco + target-folder: docs/latest/jacoco