build: update Develocity Plugin to v4 #1214
Workflow file for this run
This file contains hidden or 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' | |
| permissions: | |
| contents: read | |
| packages: read | |
| jobs: | |
| datastore-build: | |
| name: "Build Datastore Project" | |
| runs-on: ubuntu-24.04 | |
| 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.GRAILS_DEVELOCITY_ACCESS_KEY }} | |
| - name: "π¨ Run Build" | |
| id: build | |
| env: | |
| GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
| run: ./gradlew cleanTest build --continue -PonlyDatastoreTests | |
| mongodb-build: | |
| name: "Build Mongodb Project" | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java: [ 17, 21 ] | |
| mongodb-version: [ '5', '6', '7', '8' ] | |
| services: | |
| mongodb: | |
| image: mongo:${{ matrix.mongodb-version }} | |
| ports: | |
| - 27017:27017 | |
| options: >- | |
| --health-cmd "mongosh --eval 'db.adminCommand(\"ping\")'" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| 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.GRAILS_DEVELOCITY_ACCESS_KEY }} | |
| - name: "π¨ Run Build" | |
| id: build | |
| env: | |
| GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
| run: ./gradlew cleanTest build --continue -PonlyMongodbTests | |
| hibernate5-build: | |
| name: "Build Hibernate5 Project" | |
| runs-on: ubuntu-24.04 | |
| 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.GRAILS_DEVELOCITY_ACCESS_KEY }} | |
| - name: "π¨ Run Build" | |
| id: build | |
| env: | |
| GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
| run: ./gradlew cleanTest build --continue -PonlyHibernate5Tests | |
| publish: | |
| if: github.event_name == 'push' | |
| name: "Publish Snapshot" | |
| needs: [datastore-build, hibernate5-build, mongodb-build] | |
| runs-on: ubuntu-24.04 | |
| 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.GRAILS_DEVELOCITY_ACCESS_KEY }} | |
| - name: "π€ Publish Snapshot artifacts" | |
| env: | |
| GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
| GRAILS_PUBLISH_RELEASE: 'false' | |
| MAVEN_PUBLISH_URL: ${{ secrets.GRAILS_NEXUS_PUBLISH_SNAPSHOT_URL }} | |
| MAVEN_PUBLISH_USERNAME: ${{ secrets.NEXUS_USER }} | |
| MAVEN_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PW }} | |
| run: ./gradlew --no-build-cache publish | |
| docs: | |
| if: github.event_name == 'push' | |
| needs: publish | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write # so gh-pages can be updated | |
| 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.GRAILS_DEVELOCITY_ACCESS_KEY }} | |
| - name: "π¨ Build Docs" | |
| env: | |
| GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
| run: ./gradlew docs | |
| - name: "π Publish to Github Pages" | |
| uses: apache/grails-github-actions/deploy-github-pages@asf | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GRADLE_PUBLISH_RELEASE: 'false' | |
| SOURCE_FOLDER: build/docs | |
| trigger-build-gorm-impls: | |
| if: github.event_name == 'push' | |
| name: "Trigger Build in GORM Implementations" | |
| needs: [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 Hibernate6" | |
| continue-on-error: true | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GRAILS_GH_TOKEN }} # must be a PAT since we're triggering on an external repo | |
| script: | | |
| try { | |
| const result = await github.rest.actions.createWorkflowDispatch({ | |
| owner: 'apache', | |
| repo: 'grails-data-hibernate6', | |
| workflow_id: 'gradle.yml', | |
| ref: '${{ steps.extract_branch.outputs.value }}' | |
| }); | |
| console.log(result); | |
| } catch(error) { | |
| console.error(error); | |
| core.setFailed(error); | |
| } |