Pin dependencies #4423
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: | |
- '[4-9]+.[0-9]+.x' | |
- '[3-9]+.[3-9]+.x' | |
pull_request: | |
branches: | |
- '[4-9]+.[0-9]+.x' | |
- '[3-9]+.[3-9]+.x' | |
workflow_dispatch: | |
jobs: | |
build: | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
strategy: | |
matrix: | |
java: [17, 21, 23] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: "π₯ Checkout repository" | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: "βοΈ Setup JDK" | |
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4 | |
with: | |
distribution: liberica | |
java-version: ${{ matrix.java }} | |
- name: "π Setup Gradle" | |
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4 | |
with: | |
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | |
- name: "π¨ Build project" | |
id: build | |
env: | |
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} | |
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} | |
run: ./gradlew build assemble groovydoc | |
publish: | |
if: github.event_name == 'push' | |
needs: build | |
permissions: | |
contents: read # limit to read access | |
runs-on: ubuntu-latest | |
steps: | |
- name: "π₯ Checkout repository" | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: "βοΈ Setup JDK" | |
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4 | |
with: | |
distribution: liberica | |
java-version: 17 | |
- name: "π Setup Gradle" | |
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4 | |
with: | |
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | |
- name: "π€ Publish Snapshot Artifacts to Artifactory (repo.grails.org/libs-snapshot-local)" | |
id: publish | |
env: | |
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} | |
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} | |
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} | |
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} | |
run: > | |
./gradlew | |
-Dorg.gradle.internal.publish.checksums.insecure=true | |
publish | |
docs: | |
if: github.event_name == 'push' | |
needs: publish | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read # limit to read access | |
steps: | |
- name: "π Store the target branch" | |
id: extract_branch | |
run: | | |
echo "Determining Target Branch" | |
TARGET_BRANCH=${GITHUB_REF#refs/heads/} | |
echo $TARGET_BRANCH | |
echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT | |
- name: "π‘ Invoke the grails-doc release workflow" | |
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/grails-doc | |
ref: ${{ steps.extract_branch.outputs.value }} | |
token: ${{ secrets.GH_TOKEN }} | |
invoke-third-party-workflows: | |
if: github.event_name == 'push' | |
needs: [build, publish] | |
permissions: | |
contents: read # limit to read access | |
runs-on: ubuntu-latest | |
steps: | |
- name: "π Store the target branch" | |
id: extract_branch | |
run: | | |
echo "Determining 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 Core Snapshot $(date) - $GITHUB_SHA\"}" >> $GITHUB_OUTPUT | |
- name: "π‘ Invoke the Java CI workflow in Grails Functional Tests" | |
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/grails-functional-tests | |
ref: ${{ steps.extract_branch.outputs.value }} | |
token: ${{ secrets.GH_TOKEN }} | |
inputs: ${{ steps.dispatch_message.outputs.value }} |