Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit ffa85bb

Browse files
authored
Merge pull request #201 from grails/copyGithubWorkflow
Copy GitHub workflow from master
2 parents 081dbe2 + 4c2cebe commit ffa85bb

File tree

6 files changed

+253
-1
lines changed

6 files changed

+253
-1
lines changed

.github/release-drafter.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name-template: $NEXT_PATCH_VERSION
2+
tag-template: v$NEXT_PATCH_VERSION
3+
categories:
4+
- title: 🚀 Features
5+
labels:
6+
- "type: enhancement"
7+
- "type: new feature"
8+
- "type: major"
9+
- title: 🚀 Bug Fixes/Improvements
10+
labels:
11+
- "type: improvement"
12+
- "type: bug"
13+
- "type: minor"
14+
- title: 🛠 Dependency upgrades
15+
labels:
16+
- "type: dependency-upgrade"
17+
- "dependencies"
18+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
19+
template: |
20+
## Changes
21+
22+
$CHANGES
23+
24+
## Contributors
25+
26+
$CONTRIBUTORS

.github/workflows/gradle.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Java CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- '[7-9]+.[0-9]+.x'
7+
pull_request:
8+
branches:
9+
- master
10+
- '[7-9]+.[0-9]+.x'
11+
workflow_dispatch:
12+
inputs:
13+
message:
14+
description: 'Snapshot information (e.g. New Core Snapshot Tue Dec 15 00:07:18 UTC 2020 f212f54)'
15+
required: true
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
java: ['8', '11']
22+
mongodb-version: ['3.6']
23+
env:
24+
WORKSPACE: ${{ github.workspace }}
25+
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
26+
steps:
27+
- name: Print Dispatch Information
28+
if: github.event_name == 'workflow_dispatch'
29+
env:
30+
DISPATCH_INFORMATION: ${{ github.event.inputs.message }}
31+
run: echo $DISPATCH_INFORMATION
32+
- uses: actions/checkout@v2
33+
- uses: actions/cache@v2
34+
with:
35+
path: ~/.gradle/caches
36+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
37+
restore-keys: |
38+
${{ runner.os }}-gradle-
39+
- name: Set up JDK
40+
uses: actions/setup-java@v1
41+
with:
42+
java-version: ${{ matrix.java }}
43+
- name: Optional setup step
44+
run: |
45+
[ -f ./setup.sh ] && ./setup.sh || true
46+
- name: Start MongoDB
47+
uses: supercharge/[email protected]
48+
with:
49+
mongodb-version: ${{ matrix.mongodb-version }}
50+
- name: Compile and Run Tests
51+
run: |
52+
./gradlew compileGroovy --no-daemon
53+
./gradlew compileTestGroovy --no-daemon
54+
./gradlew -Dgeb.env=chromeHeadless check --no-daemon
55+
- name: Publish Test Report
56+
uses: scacap/action-surefire-report@v1
57+
with:
58+
github_token: ${{ secrets.GITHUB_TOKEN }}
59+
report_paths: '**/build/test-results/test/TEST-*.xml'
60+
- name: Publish to repo.grails.org
61+
if: success() && github.event_name == 'push' && matrix.java == '8'
62+
env:
63+
SECRING_FILE: ${{ secrets.SECRING_FILE }}
64+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
65+
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
66+
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
67+
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
68+
run: |
69+
echo $SECRING_FILE | base64 -d > secring.gpg
70+
./gradlew -Dorg.gradle.internal.publish.checksums.insecure=true -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="secring.gpg" publish
71+
echo "Publishing Documentation..."
72+
./gradlew docs:docs
73+
- name: Determine docs target repository
74+
if: success() && github.event_name == 'push' && matrix.java == '8'
75+
uses: haya14busa/action-cond@v1
76+
id: docs_target
77+
with:
78+
cond: ${{ github.repository == 'grails/gorm-mongodb' }}
79+
if_true: "grails/grails-data-mapping"
80+
if_false: ${{ github.repository }}
81+
- name: Publish to Github Pages
82+
if: success() && github.event_name == 'push' && matrix.java == '8'
83+
uses: micronaut-projects/github-pages-deploy-action@master
84+
env:
85+
TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }}
86+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
87+
BRANCH: gh-pages
88+
FOLDER: docs/build/docs
89+
DOC_SUB_FOLDER: mongodb
90+
DOC_FOLDER: gh-pages
91+
COMMIT_EMAIL: [email protected]
92+
COMMIT_NAME: Puneet Behl
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Changelog
2+
on:
3+
issues:
4+
types: [closed,reopened]
5+
push:
6+
branches:
7+
- master
8+
- '[7-9]+.[0-9]+.x'
9+
jobs:
10+
release_notes:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Check if it has release drafter config file
15+
id: check_release_drafter
16+
run: |
17+
has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false")
18+
echo ::set-output name=has_release_drafter::${has_release_drafter}
19+
20+
# If it has release drafter:
21+
- uses: release-drafter/release-drafter@v5
22+
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
25+
# Otherwise:
26+
- name: Export Gradle Properties
27+
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
28+
uses: micronaut-projects/github-actions/export-gradle-properties@master
29+
- uses: micronaut-projects/github-actions/release-notes@master
30+
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
31+
id: release_notes
32+
with:
33+
token: ${{ secrets.GH_TOKEN }}
34+
- uses: ncipollo/release-action@v1
35+
if: steps.check_release_drafter.outputs.has_release_drafter == 'false' && steps.release_notes.outputs.generated_changelog == 'true'
36+
with:
37+
allowUpdates: true
38+
commit: ${{ steps.release_notes.outputs.current_branch }}
39+
draft: true
40+
name: ${{ env.title }} ${{ steps.release_notes.outputs.next_version }}
41+
tag: v${{ steps.release_notes.outputs.next_version }}
42+
bodyFile: CHANGELOG.md
43+
token: ${{ secrets.GH_TOKEN }}

.github/workflows/release.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
java: ['8']
11+
env:
12+
GIT_USER_NAME: puneetbehl
13+
GIT_USER_EMAIL: [email protected]
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v2
17+
with:
18+
token: ${{ secrets.GH_TOKEN }}
19+
- uses: gradle/wrapper-validation-action@v1
20+
- name: Set up JDK
21+
uses: actions/setup-java@v1
22+
with:
23+
java-version: ${{ matrix.java }}
24+
- name: Set the current release version
25+
id: release_version
26+
run: echo ::set-output name=release_version::${GITHUB_REF:11}
27+
- name: Run pre-release
28+
uses: micronaut-projects/github-actions/pre-release@master
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
- name: Publish, Upload to Bintray
32+
env:
33+
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
34+
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
35+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
36+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
37+
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
38+
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
39+
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
40+
run: |
41+
echo "Publishing Artifacts"
42+
./gradlew bintrayUpload
43+
echo "Publishing Documentation"
44+
./gradlew docs:docs
45+
- name: Export Gradle Properties
46+
uses: micronaut-projects/github-actions/export-gradle-properties@master
47+
- name: Determine docs target repository
48+
if: success()
49+
uses: haya14busa/action-cond@v1
50+
id: docs_target
51+
with:
52+
cond: ${{ github.repository == 'grails/gorm-mongodb' }}
53+
if_true: "grails/grails-data-mapping"
54+
if_false: ${{ github.repository }}
55+
- name: Publish to Github Pages
56+
if: success()
57+
uses: micronaut-projects/github-pages-deploy-action@master
58+
env:
59+
BETA: ${{ contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }}
60+
TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }}
61+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
62+
BRANCH: gh-pages
63+
FOLDER: docs/build/docs
64+
DOC_SUB_FOLDER: mongodb
65+
DOC_FOLDER: gh-pages
66+
COMMIT_EMAIL: [email protected]
67+
COMMIT_NAME: Puneet Behl
68+
VERSION: ${{ steps.release_version.outputs.release_version }}
69+
- name: Create Message for the Maven Central Sync
70+
if: success()
71+
id: maven_sync_message
72+
run: |
73+
echo ::set-output name=value::{\"release_version\":\"$RELEASE_VERSION\"}
74+
env:
75+
RELEASE_VERSION: ${{ steps.release_version.outputs.release_version }}
76+
- name: Invoke the Maven Central Sync workflow
77+
if: success()
78+
uses: benc-uk/[email protected]
79+
with:
80+
workflow: Maven Central Sync
81+
ref: master
82+
token: ${{ secrets.GH_TOKEN }}
83+
inputs: ${{ steps.maven_sync_message.outputs.value }}
84+
- name: Run post-release
85+
if: success()
86+
uses: micronaut-projects/github-actions/post-release@master
87+
with:
88+
token: ${{ secrets.GITHUB_TOKEN }}
89+
env:
90+
SNAPSHOT_SUFFIX: .BUILD-SNAPSHOT

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ buildscript {
2222
logger.lifecycle "GORM VERSION = ${project.datastoreVersion}"
2323

2424
group "org.grails"
25-
version "7.0.2.BUILD-SNAPSHOT"
25+
version project.projectVersion
2626

2727
ext {
2828
isTravisBuild = System.getenv().get("TRAVIS") == 'true'

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ mongodbDriverVersion=3.10.0
88
mongodbRxDriverVersion=1.10.0
99
mongoJavaServerVersion=1.9.8
1010
hibernateValidatorVersion=6.0.13.Final
11+
projectVersion=7.0.2.BUILD-SNAPSHOT
1112
spockVersion=1.2-groovy-2.5
1213
assetPipelineVersion=3.0.7
1314
gebVersion=2.3

0 commit comments

Comments
 (0)