Skip to content

Commit c185abb

Browse files
authored
Updating build process for new publishing strategy (#236)
1 parent 64dc5c7 commit c185abb

File tree

11 files changed

+282
-121
lines changed

11 files changed

+282
-121
lines changed

.github/workflows/gradle.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Java CI
2+
on:
3+
push:
4+
branches:
5+
- '[5-9].[0-9].x'
6+
pull_request:
7+
branches:
8+
- '[5-9].[0-9].x'
9+
workflow_dispatch:
10+
env:
11+
GIT_USER_NAME: 'grails-build'
12+
GIT_USER_EMAIL: 'grails-build@users.noreply.github.com'
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: "📥 Checkout the repository"
18+
uses: actions/checkout@v4
19+
- name: "☕️ Setup JDK"
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: 'liberica'
23+
java-version: '17'
24+
- name: "🐘 Setup Gradle"
25+
uses: gradle/actions/setup-gradle@v4
26+
- name: "🔨 Run Build"
27+
env:
28+
DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
29+
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
30+
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
31+
run: ./gradlew check
32+
publish:
33+
if: github.event_name == 'push'
34+
needs: build
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: read
38+
steps:
39+
- name: "📥 Checkout the repository"
40+
uses: actions/checkout@v4
41+
- name: "☕️ Setup JDK"
42+
uses: actions/setup-java@v4
43+
with:
44+
distribution: 'liberica'
45+
java-version: '17'
46+
- name: "🐘 Setup Gradle"
47+
uses: gradle/actions/setup-gradle@v4
48+
- name: "📤 Publish to Snapshot (repo.grails.org)"
49+
env:
50+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
51+
MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }}
52+
MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PUBLISH_PASSWORD }}
53+
MAVEN_PUBLISH_URL: ${{ secrets.MAVEN_PUBLISH_SNAPSHOT_URL }}
54+
working-directory: ./plugin
55+
run: ../gradlew publish
56+
- name: "📜 Generate Documentation"
57+
if: success()
58+
env:
59+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
60+
working-directory: ./plugin
61+
run: ../gradlew docs
62+
- name: "🚀 Publish to Github Pages"
63+
if: success()
64+
uses: micronaut-projects/github-pages-deploy-action@grails
65+
env:
66+
SKIP_SNAPSHOT: ${{ contains(needs.publish.outputs.release_version, 'M') }}
67+
TARGET_REPOSITORY: ${{ github.repository }}
68+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
69+
BRANCH: gh-pages
70+
FOLDER: plugin/build/docs
71+
DOC_FOLDER: gh-pages
72+
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
73+
COMMIT_NAME: ${{ env.GIT_USER_NAME }}

.github/workflows/release.yml

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [published]
5+
env:
6+
GIT_USER_NAME: 'grails-build'
7+
GIT_USER_EMAIL: 'grails-build@users.noreply.github.com'
8+
jobs:
9+
publish:
10+
permissions:
11+
contents: write # to create release
12+
issues: write # to modify milestones
13+
runs-on: ubuntu-latest
14+
outputs:
15+
release_version: ${{ steps.release_version.outputs.value }}
16+
target_branch: ${{ steps.extract_branch.outputs.value }}
17+
env:
18+
GIT_USER_NAME: 'grails-build'
19+
GIT_USER_EMAIL: 'grails-build@users.noreply.github.com'
20+
steps:
21+
- name: "📥 Checkout the repository"
22+
uses: actions/checkout@v4
23+
with:
24+
token: ${{ secrets.GH_TOKEN }}
25+
- name: "☕️ Setup JDK"
26+
uses: actions/setup-java@v4
27+
with:
28+
distribution: 'temurin'
29+
java-version: '17'
30+
- name: "🐘 Setup Gradle"
31+
uses: gradle/actions/setup-gradle@v4
32+
- name: "📝 Store the target branch"
33+
id: extract_branch
34+
run: |
35+
echo "Determining Target Branch"
36+
TARGET_BRANCH=${GITHUB_REF#refs/heads/}
37+
echo $TARGET_BRANCH
38+
echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT
39+
- name: "📝Set the current release version"
40+
id: release_version
41+
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
42+
- name: "⚙️ Run pre-release"
43+
uses: micronaut-projects/github-actions/pre-release@master
44+
with:
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
- name: "🧩 Run Assemble"
47+
if: success()
48+
id: assemble
49+
env:
50+
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
51+
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
52+
run: ./gradlew assemble
53+
- name: "📝 Generate secring file"
54+
env:
55+
SECRING_FILE: ${{ secrets.SECRING_FILE }}
56+
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
57+
- name: "🚀 Publish to Sonatype OSSRH"
58+
id: publish
59+
env:
60+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
61+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
62+
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
63+
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
64+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
65+
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
66+
SECRING_FILE: ${{ secrets.SECRING_FILE }}
67+
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
68+
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
69+
working-directory: ./plugin
70+
run: >
71+
../gradlew
72+
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
73+
publishToSonatype
74+
closeSonatypeStagingRepository
75+
release:
76+
needs: publish
77+
runs-on: ubuntu-latest
78+
permissions:
79+
contents: read
80+
steps:
81+
- name: "📥 Checkout repository"
82+
uses: actions/checkout@v4
83+
- name: "☕️ Setup JDK"
84+
uses: actions/setup-java@v4
85+
with:
86+
distribution: liberica
87+
java-version: 17
88+
- name: "📥 Checkout repository"
89+
uses: actions/checkout@v4
90+
with:
91+
token: ${{ secrets.GH_TOKEN }}
92+
ref: v${{ needs.publish.outputs.release_version }}
93+
- name: "🐘 Setup Gradle"
94+
uses: gradle/actions/setup-gradle@v4
95+
with:
96+
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
97+
- name: "🏆Nexus Staging Close And Release"
98+
env:
99+
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
100+
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
101+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
102+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
103+
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
104+
working-directory: ./plugin
105+
run: >
106+
../gradlew
107+
findSonatypeStagingRepository
108+
releaseSonatypeStagingRepository
109+
- name: "⚙️Run post-release"
110+
if: success()
111+
uses: micronaut-projects/github-actions/post-release@master
112+
with:
113+
token: ${{ secrets.GITHUB_TOKEN }}
114+
env:
115+
SNAPSHOT_SUFFIX: -SNAPSHOT
116+
docs:
117+
needs: publish
118+
runs-on: ubuntu-latest
119+
permissions:
120+
contents: write
121+
steps:
122+
- name: "📥 Checkout the repository"
123+
uses: actions/checkout@v4
124+
with:
125+
token: ${{ secrets.GH_TOKEN }}
126+
ref: v${{ needs.publish.outputs.release_version }}
127+
- name: "☕️ Setup JDK"
128+
uses: actions/setup-java@v4
129+
with:
130+
distribution: 'liberica'
131+
java-version: '17'
132+
- name: "🐘 Setup Gradle"
133+
uses: gradle/actions/setup-gradle@v4
134+
- name: "📜 Generate Documentation"
135+
id: docs
136+
env:
137+
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
138+
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
139+
working-directory: ./plugin
140+
run: ../gradlew docs
141+
- name: "🚀 Publish to Github Pages"
142+
id: docs
143+
if: success()
144+
uses: grails/github-pages-deploy-action@v2
145+
env:
146+
SKIP_SNAPSHOT: ${{ contains(needs.publish.outputs.release_version, 'M') }}
147+
# if multiple releases are being done, this is the last branch - 1 version
148+
#SKIP_LATEST: ${{ !startsWith(needs.publish.outputs.target_branch, '6.2') }}
149+
TARGET_REPOSITORY: ${{ github.repository }}
150+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
151+
BRANCH: gh-pages
152+
FOLDER: plugin/build/docs
153+
DOC_FOLDER: gh-pages
154+
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
155+
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
156+
VERSION: ${{ needs.publish.outputs.release_version }}

.sdkmanrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Enable auto-env through the sdkman_auto_env config - https://sdkman.io/usage#env
2+
java=17.0.12-librca

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# Grails Audit Logging Plugin
1+
Grails Audit Logging Plugin
2+
===
3+
[![Java CI](https://github.com/grails/grails-core/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/grails/grails-core/actions/workflows/gradle.yml)
4+
![Grails 7 Compatible](https://img.shields.io/badge/Compatible-brightGreen?label=Grails%207&labelColor=grey)
25

3-
This plugin was originally maintained by [symentis](https://github.com/symentis) and was gracefully donated to the GPC
6+
This plugin was originally maintained by [symentis](https://github.com/symentis) and was gracefully donated to the grails developers to maintain.
47

58
## Description
69

@@ -9,8 +12,9 @@ The Audit Logging plugin for Grails adds generic event based Audit Logging to a
912
The master branch holds the codebase for plugin version 4.0.x (Grails 4.0.x).
1013

1114
For older Grails versions, see "Supported Grails Versions" below.
15+
1216
## Moving to Maven Central
13-
This repositories new artifacts are currently moved to Maven Central, sind Bintray will shut down MAY/01/21. You can obtain the old artifacts from https://repo.grails.org.
17+
This repositories new artifacts are currently moved to Maven Central, since Bintray shut down MAY/01/21. You can obtain the old artifacts from https://repo.grails.org.
1418

1519
## Documentation
1620
* For current release documentation, see [User Guide](https://gpc.github.io/grails-audit-logging-plugin/latest/plugin.html)

gradle.properties

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,3 @@ gradleWrapperVersion=8.11
1111
org.gradle.daemon=true
1212
org.gradle.parallel=true
1313
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M
14-
15-
vcsUrl=https://github.com/gpc/grails-audit-logging-plugin
16-
websiteUrl=https://github.com/gpc/grails-audit-logging-plugin
17-
issueTrackerUrl=https://github.com/gpc/grails-audit-logging-plugin/issues

gradle/artifactoryPublish.gradle

Lines changed: 0 additions & 13 deletions
This file was deleted.

gradle/grailsPublish.gradle

Lines changed: 0 additions & 22 deletions
This file was deleted.

makedoc.sh

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)