-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #355 from jdaugherty/7.0.x
#350 - Rework publishing plugins so they can be used externally and on multi-project builds
- Loading branch information
Showing
32 changed files
with
482 additions
and
326 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,70 +12,80 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: ['17'] | ||
env: | ||
WORKSPACE: ${{ github.workspace }} | ||
java: ['17', '21'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK | ||
- name: "📥 Checkout repository" | ||
uses: actions/checkout@v4 | ||
- name: "☕️ Setup JDK" | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
distribution: liberica | ||
java-version: ${{ matrix.java }} | ||
- name: Run Build | ||
- name: "🐘 Setup Gradle" | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
- name: "🔨 Build project" | ||
id: build | ||
uses: gradle/gradle-build-action@v3 | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
with: | ||
arguments: build -Dgeb.env=chromeHeadless | ||
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 | ||
publish: | ||
if: github.event_name == 'push' | ||
needs: ['build'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK | ||
- name: "📥 Checkout repository" | ||
uses: actions/checkout@v4 | ||
- name: "☕️ Setup JDK" | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
distribution: liberica | ||
java-version: 17 | ||
- name: Publish Artifacts (repo.grails.org) | ||
- 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 | ||
uses: gradle/gradle-build-action@v3 | ||
env: | ||
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} | ||
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
with: | ||
arguments: | | ||
-Dorg.gradle.internal.publish.checksums.insecure=true | ||
publish | ||
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: write | ||
env: | ||
GIT_USER_NAME: puneetbehl | ||
GIT_USER_EMAIL: [email protected] | ||
GIT_USER_NAME: grails-build | ||
GIT_USER_EMAIL: [email protected] | ||
steps: | ||
- name: Checkout repository | ||
- name: "📥 Checkout repository" | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK | ||
- name: "☕️ Setup JDK" | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
distribution: liberica | ||
java-version: 17 | ||
- name: Generate Groovydoc | ||
- name: "🐘 Setup Gradle" | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
- name: "📜 Generate Groovydoc" | ||
id: groovydoc | ||
uses: gradle/gradle-build-action@v3 | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
with: | ||
arguments: groovydoc | ||
- name: Publish to Github Pages | ||
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 groovydoc | ||
- name: "🚀 Publish to Github Pages" | ||
id: docs | ||
if: success() | ||
uses: grails/github-pages-deploy-action@v2 | ||
|
@@ -86,6 +96,5 @@ jobs: | |
BRANCH: gh-pages | ||
FOLDER: build/docs | ||
DOC_FOLDER: gh-pages | ||
COMMIT_EMAIL: [email protected] | ||
COMMIT_NAME: Puneet Behl | ||
VERSION: ${{ needs.publish.outputs.release_version }} | ||
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }} | ||
COMMIT_NAME: ${{ env.GIT_USER_NAME }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,53 +12,55 @@ jobs: | |
release_version: ${{ steps.release_version.outputs.value }} | ||
target_branch: ${{ steps.extract_branch.outputs.value }} | ||
env: | ||
GIT_USER_NAME: puneetbehl | ||
GIT_USER_EMAIL: [email protected] | ||
GIT_USER_NAME: 'grails-build' | ||
GIT_USER_EMAIL: '[email protected]' | ||
steps: | ||
- name: Checkout repository | ||
- name: "📥 Checkout repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
- name: Set up JDK | ||
- name: "☕️ Setup JDK" | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
distribution: liberica | ||
java-version: 17 | ||
- name: Extract Target Branch | ||
- name: "🐘 Setup Gradle" | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
- name: "📝 Store the target branch" | ||
id: extract_branch | ||
run: | | ||
echo "Determining Target Branch" | ||
TARGET_BRANCH=`cat $GITHUB_EVENT_PATH | jq '.release.target_commitish' | sed -e 's/^"\(.*\)"$/\1/g'` | ||
TARGET_BRANCH=${GITHUB_REF#refs/heads/} | ||
echo $TARGET_BRANCH | ||
echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT | ||
- name: Set the current release version | ||
- name: "📝 Store the current release version" | ||
id: release_version | ||
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT | ||
- name: Run pre-release | ||
- name: "⚙️ Run pre-release" | ||
uses: micronaut-projects/github-actions/pre-release@master | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run Assemble | ||
- name: "🧩 Run Assemble" | ||
if: success() | ||
id: assemble | ||
uses: gradle/gradle-build-action@v3 | ||
with: | ||
arguments: assemble | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
- name: Upload Distribution | ||
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 assemble | ||
- name: "🚀 Upload Distribution" | ||
if: success() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: grails-${{ steps.release_version.outputs.value }}.zip | ||
path: build/distributions/grails-${{ steps.release_version.outputs.value }}.zip | ||
- name: Generate secring file | ||
- name: "📝 Generate secring file" | ||
env: | ||
SECRING_FILE: ${{ secrets.SECRING_FILE }} | ||
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg | ||
- name: Publish to Sonatype OSSRH | ||
- name: "🚀 Publish to Sonatype OSSRH" | ||
id: publish | ||
uses: gradle/gradle-build-action@v3 | ||
env: | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
|
@@ -67,9 +69,10 @@ jobs: | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | ||
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} | ||
SECRING_FILE: ${{ secrets.SECRING_FILE }} | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
with: | ||
arguments: | | ||
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 | ||
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg | ||
publishToSonatype | ||
closeSonatypeStagingRepository | ||
|
@@ -79,26 +82,31 @@ jobs: | |
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK | ||
- name: "📥 Checkout repository" | ||
uses: actions/checkout@v4 | ||
- name: "☕️ Setup JDK" | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
distribution: liberica | ||
java-version: 17 | ||
- name: Checkout repository | ||
- name: "📥 Checkout repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
ref: v${{ needs.publish.outputs.release_version }} | ||
- name: "🐘 Setup Gradle" | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
- name: Nexus Staging Close And Release | ||
uses: gradle/gradle-build-action@v3 | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} | ||
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} | ||
with: | ||
arguments: | | ||
run: > | ||
./gradlew | ||
findSonatypeStagingRepository | ||
releaseSonatypeStagingRepository | ||
- name: Run post-release | ||
|
@@ -114,38 +122,41 @@ jobs: | |
permissions: | ||
contents: write | ||
env: | ||
GIT_USER_NAME: puneetbehl | ||
GIT_USER_EMAIL: [email protected] | ||
GIT_USER_NAME: 'grails-build' | ||
GIT_USER_EMAIL: '[email protected]' | ||
steps: | ||
- name: Checkout repository | ||
- name: "📥 Checkout repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
ref: v${{ needs.publish.outputs.release_version }} | ||
- name: Set up JDK | ||
- name: "☕️ Setup JDK" | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
distribution: liberica | ||
java-version: 17 | ||
- name: Generate Groovydoc | ||
- name: "🐘 Setup Gradle" | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
- name: "📜 Generate Groovydoc" | ||
id: groovydoc | ||
uses: gradle/gradle-build-action@v3 | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
with: | ||
arguments: groovydoc | ||
- name: Publish to Github Pages | ||
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 groovydoc | ||
- name: "🚀 Publish to Github Pages" | ||
id: docs | ||
if: success() | ||
uses: grails/github-pages-deploy-action@v2 | ||
env: | ||
SKIP_SNAPSHOT: ${{ contains(needs.publish.outputs.release_version, 'M') }} | ||
SKIP_LATEST: ${{ !startsWith(needs.publish.outputs.target_branch, '6.1') }} | ||
SKIP_LATEST: ${{ !startsWith(needs.publish.outputs.target_branch, '6.2') }} | ||
TARGET_REPOSITORY: ${{ github.repository }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: build/docs | ||
DOC_FOLDER: gh-pages | ||
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }} | ||
COMMIT_NAME: Puneet Behl | ||
COMMIT_NAME: ${{ env.GIT_USER_NAME }} | ||
VERSION: ${{ needs.publish.outputs.release_version }} |
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
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
Oops, something went wrong.