Use ge.apache.org instead of ge.grails.org #1198
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: | |
| if: false # remove after publishing | |
| 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: | |
| # if: false # TODO: Remove once we can run mongo | |
| # name: "Build Mongodb Project" | |
| # runs-on: ubuntu-24.04 | |
| # strategy: | |
| # fail-fast: false | |
| # matrix: | |
| # java: [ 17, 21 ] | |
| # mongodb-version: [ '4', '5', '6', '7', '8' ] | |
| # 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: "βΆοΈ Start MongoDB (needed for some tests)" | |
| # uses: supercharge/mongodb-github-action@90004df786821b6308fb02299e5835d0dae05d0d # v1.12.0 (Use commit sha as this is a 3rd party action) | |
| # with: | |
| # mongodb-version: ${{ matrix.mongodb-version }} | |
| # - name: "π¨ Run Build" | |
| # id: build | |
| # env: | |
| # GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
| # run: ./gradlew cleanTest build --continue -PonlyMongodbTests | |
| hibernate5-build: | |
| if: false # TODO: Remove after publishing to core | |
| 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] # Fix once mongo db action is added | |
| 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 to repo.grails.org" | |
| env: | |
| GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
| GRADLE_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); | |
| } |