#13552 - Merge gorm-docs into grails-data-mapping #1106
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Java CI" | |
on: | |
push: | |
branches: | |
- '[7-9]+.[0-9]+.x' | |
pull_request: | |
branches: | |
- '[7-9]+.[0-9]+.x' | |
env: | |
GIT_USER_NAME: grails-build | |
GIT_USER_EMAIL: grails-build@users.noreply.github.com | |
jobs: | |
build: | |
name: "Build Project" | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: read | |
packages: read | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [17, 21] | |
steps: | |
- name: "π₯ Checkout the repository" | |
uses: actions/checkout@v4 | |
- name: "βοΈ Setup JDK" | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: liberica | |
- name: "π Setup Gradle" | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | |
- name: "π¨ Run Build" | |
id: build | |
env: | |
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew build --continue | |
publish: | |
if: github.event_name == 'push' | |
name: "Publish Snapshot" | |
needs: build | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: read | |
packages: read | |
steps: | |
- name: "π₯ Checkout the repository" | |
uses: actions/checkout@v4 | |
- name: "βοΈ Setup JDK" | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: liberica | |
- name: "π Setup Gradle" | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | |
- name: "π€ Publish Snapshot to repo.grails.org" | |
env: | |
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
GRADLE_PUBLISH_RELEASE: 'false' | |
MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }} | |
MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PUBLISH_PASSWORD }} | |
# NOTE: secrets.MAVEN_PUBLISH_URL == https://repo.grails.org/grails/plugins3-snapshot-local | |
MAVEN_PUBLISH_URL: https://repo.grails.org/grails/libs-snapshots-local | |
run: ./gradlew --no-build-cache publish | |
docs: | |
if: github.event_name == 'push' | |
needs: publish | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: write | |
packages: read | |
steps: | |
- name: "π₯ Checkout the repository" | |
uses: actions/checkout@v4 | |
- name: "βοΈ Setup JDK" | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'liberica' | |
java-version: '17' | |
- name: "π Setup Gradle" | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | |
- name: "π¨ Build Docs" | |
id: docs | |
env: | |
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew docs --refresh-dependencies | |
- name: "π€ Publish docs to Github Pages" | |
if: steps.docs.outcome == 'success' | |
uses: grails/github-pages-deploy-action@v2 | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
BRANCH: gh-pages | |
FOLDER: build/docs | |
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }} | |
COMMIT_NAME: ${{ env.GIT_USER_NAME }} | |
trigger-build-gorm-impls: | |
if: github.event_name == 'push' | |
name: "Trigger Build in GORM Implementations" | |
needs: [build, publish] | |
runs-on: ubuntu-24.04 | |
continue-on-error: true | |
steps: | |
- name: "π Store the target branch" | |
id: extract_branch | |
run: | | |
echo "π Determine Target Branch" | |
TARGET_BRANCH=${GITHUB_REF#refs/heads/} | |
echo $TARGET_BRANCH | |
echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT | |
- name: "π Create Snapshot Message for the Workflow Dispatch" | |
id: dispatch_message | |
run: echo "value={\"message\":\"New Data Mapping Snapshots $(date) - $GITHUB_SHA\"}" >> $GITHUB_OUTPUT | |
- name: "π‘ Invoke the Java CI workflow in GORM Hibernate5" | |
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 (Use commit sha as this is a 3rd party action) | |
continue-on-error: true | |
with: | |
workflow: Java CI | |
repo: grails/gorm-hibernate5 | |
ref: ${{ steps.extract_branch.outputs.value }} | |
token: ${{ secrets.GH_TOKEN }} | |
- name: "π‘ Invoke the Java CI workflow in GORM Hibernate6" | |
continue-on-error: true | |
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 (Use commit sha as this is a 3rd party action) | |
with: | |
workflow: Java CI | |
repo: grails/gorm-hibernate6 | |
ref: ${{ steps.extract_branch.outputs.value }} | |
token: ${{ secrets.GH_TOKEN }} | |
- name: "π‘ Invoke the Java CI workflow in GORM MongoDB" | |
continue-on-error: true | |
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 (Use commit sha as this is a 3rd party action) | |
with: | |
workflow: Java CI | |
repo: grails/gorm-mongodb | |
ref: ${{ steps.extract_branch.outputs.value }} | |
token: ${{ secrets.GH_TOKEN }} | |
inputs: ${{ steps.dispatch_message.outputs.value }} | |
- name: "π‘ Invoke the Java CI workflow in GORM Neo4j" | |
if: false # Skip until neo4j is ported to grails 7 | |
continue-on-error: true | |
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 (Use commit sha as this is a 3rd party action) | |
with: | |
workflow: Java CI | |
repo: grails/gorm-neo4j | |
ref: ${{ steps.extract_branch.outputs.value }} | |
token: ${{ secrets.GH_TOKEN }} |