Skip to content

Fix purging pre release packages & add missing packages to bom #4499

Fix purging pre release packages & add missing packages to bom

Fix purging pre release packages & add missing packages to bom #4499

Workflow file for this run

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:
skip_check:
runs-on: ubuntu-latest
outputs:
found_skip_publish: ${{ steps.check_prevent_property.outputs.value }}
permissions:
contents: read
steps:
- name: "πŸ“₯ Checkout repository"
uses: actions/checkout@v4
- name: "πŸ” Check if we should skip publish"
id: check_prevent_property
run: |
if grep -q '^preventSnapshotPublish=true' gradle.properties; then
echo "value=true" >> $GITHUB_OUTPUT
else
echo "value=false" >> $GITHUB_OUTPUT
fi
build:
needs: skip_check
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@v4
- name: "β˜•οΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@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.skip_check.outputs.found_skip_publish != 'true'
needs: build
permissions:
contents: read # limit to read access
runs-on: ubuntu-latest
steps:
- name: "πŸ“₯ Checkout 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.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.skip_check.outputs.found_skip_publish != 'true'
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 }}