From 5122c06f94e6593959b992ebd5e8202654880dd3 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Sun, 15 Sep 2024 23:56:55 +0200 Subject: [PATCH] Publish docs zip --- .github/maven-cd-settings.xml | 63 +++++++++++++++++++++++++++++++++++ .github/maven-ci-settings.xml | 55 ++++++++++++++++++++++++++++++ .github/workflows/ci-5.x.yml | 39 ++++++++++++++++++++++ .github/workflows/ci.yml | 39 +++++++++++----------- .github/workflows/deploy.yml | 32 ++++++++++++++++++ .github/workflows/publish.yml | 33 ++++++++++++++++++ pom.xml | 2 +- 7 files changed, 242 insertions(+), 21 deletions(-) create mode 100644 .github/maven-cd-settings.xml create mode 100644 .github/maven-ci-settings.xml create mode 100644 .github/workflows/ci-5.x.yml create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/maven-cd-settings.xml b/.github/maven-cd-settings.xml new file mode 100644 index 0000000..1ee3124 --- /dev/null +++ b/.github/maven-cd-settings.xml @@ -0,0 +1,63 @@ + + + + + false + + + + vertx-snapshots-repository + ${env.VERTX_NEXUS_USERNAME} + ${env.VERTX_NEXUS_PASSWORD} + + + + + + google-mirror + + true + + + + google-maven-central + GCS Maven Central mirror EU + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + + google-maven-central + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + + diff --git a/.github/maven-ci-settings.xml b/.github/maven-ci-settings.xml new file mode 100644 index 0000000..24b5bdb --- /dev/null +++ b/.github/maven-ci-settings.xml @@ -0,0 +1,55 @@ + + + + + false + + + + google-mirror + + true + + + + google-maven-central + GCS Maven Central mirror EU + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + + google-maven-central + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + + diff --git a/.github/workflows/ci-5.x.yml b/.github/workflows/ci-5.x.yml new file mode 100644 index 0000000..a460a9c --- /dev/null +++ b/.github/workflows/ci-5.x.yml @@ -0,0 +1,39 @@ +name: advanced-vertx-guide (5.x) +on: + push: + branches: + - master + pull_request: + branches: + - master + schedule: + - cron: '0 5 * * *' +jobs: + CI: + strategy: + matrix: + include: + - os: ubuntu-latest + jdk: 11 + uses: ./.github/workflows/ci.yml + with: + branch: ${{ github.event.pull_request.head.sha || github.ref_name }} + jdk: ${{ matrix.jdk }} + os: ${{ matrix.os }} + secrets: inherit + Deploy: + if: ${{ github.repository_owner == 'vert-x3' && (github.event_name == 'push' || github.event_name == 'schedule') }} + needs: CI + uses: ./.github/workflows/deploy.yml + with: + branch: ${{ github.event.pull_request.head.sha || github.ref_name }} + jdk: 11 + secrets: inherit + Publish: + if: ${{ github.repository_owner == 'vert-x3' && (github.event_name == 'push' || github.event_name == 'schedule') }} + needs: CI + uses: ./.github/workflows/publish.yml + with: + branch: ${{ github.event.pull_request.head.sha || github.ref_name }} + jdk: 11 + secrets: inherit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92ac85c..f698808 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,30 +1,29 @@ -name: asciidoc +name: CI on: - push: - branches: - - master + workflow_call: + inputs: + branch: + required: true + type: string + jdk: + default: 8 + type: string + os: + default: ubuntu-latest + type: string jobs: Test: - name: Deploy docs zip - strategy: - matrix: - os: [ubuntu-latest] - jdk: [11] - runs-on: ${{ matrix.os }} + name: Run tests + runs-on: ${{ inputs.os }} steps: - name: Checkout uses: actions/checkout@v2 + with: + ref: ${{ inputs.branch }} - name: Install JDK uses: actions/setup-java@v2 with: - java-version: 11 + java-version: ${{ inputs.jdk }} distribution: temurin - - name: Render guide - run: mvn compile asciidoctor:process-asciidoc - - name: Publish to GitHub Pages - uses: JamesIves/github-pages-deploy-action@3.7.1 - with: - GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} - BRANCH: gh-pages - FOLDER: target/docs/advanced-vertx-guide - CLEAN: true + - name: Run tests + run: mvn -s .github/maven-ci-settings.xml -q clean verify -B diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..63dbced --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: Deploy +on: + workflow_call: + inputs: + branch: + required: true + type: string + jdk: + default: 8 + type: string +jobs: + Deploy: + name: Deploy to OSSRH + runs-on: ubuntu-latest + env: + VERTX_NEXUS_USERNAME: ${{ secrets.VERTX_NEXUS_USERNAME }} + VERTX_NEXUS_PASSWORD: ${{ secrets.VERTX_NEXUS_PASSWORD }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ inputs.branch }} + - name: Install JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ inputs.jdk }} + distribution: temurin + - name: Get project version + run: echo "PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -q -DforceStdout | grep -v '\[')" >> $GITHUB_ENV + - name: Maven deploy + if: ${{ endsWith(env.PROJECT_VERSION, '-SNAPSHOT') }} + run: mvn deploy -s .github/maven-cd-settings.xml -DskipTests -B diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..69b0ad1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Publish +on: + workflow_call: + inputs: + branch: + required: true + type: string + jdk: + default: 8 + type: string +jobs: + Deploy: + name: Publish to Pages + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ inputs.branch }} + - name: Install JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ inputs.jdk }} + distribution: temurin + - name: Maven deploy + run: mvn package asciidoctor:process-asciidoc + - name: Publish to GitHub Pages + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} + BRANCH: gh-pages + FOLDER: target/docs/advanced-vertx-guide + CLEAN: true diff --git a/pom.xml b/pom.xml index 0349c00..97ffbad 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ advanced-vertx-guide - 1.0-SNAPSHOT + 1.0.0-SNAPSHOT 5.0.0-SNAPSHOT