From 974be2a879e77caedf3de1faf7bc67aa6dbd7315 Mon Sep 17 00:00:00 2001 From: Puneet Behl Date: Thu, 4 Mar 2021 04:06:22 +0530 Subject: [PATCH 1/2] Copy Github Workflow configurations from master, and disable Travis --- .github/release-drafter.yml | 26 +++++++++ .github/workflows/gradle.yml | 85 +++++++++++++++++++++++++++ .github/workflows/release-notes.yml | 43 ++++++++++++++ .github/workflows/release.yml | 90 +++++++++++++++++++++++++++++ .travis.yml | 3 + 5 files changed, 247 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/gradle.yml create mode 100644 .github/workflows/release-notes.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000000..8ed0ae4524 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,26 @@ +name-template: $NEXT_PATCH_VERSION +tag-template: v$NEXT_PATCH_VERSION +categories: + - title: 🚀 Features + labels: + - "type: enhancement" + - "type: new feature" + - "type: major" + - title: 🚀 Bug Fixes/Improvements + labels: + - "type: improvement" + - "type: bug" + - "type: minor" + - title: 🛠 Dependency upgrades + labels: + - "type: dependency upgrade" + - "dependencies" +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +template: | + ## Changes + + $CHANGES + + ## Contributors + + $CONTRIBUTORS diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000000..a139278202 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,85 @@ +name: Java CI +on: + push: + branches: + - master + - '[7-9]+.[0-9]+.x' + pull_request: + branches: + - master + - '[7-9]+.[0-9]+.x' + workflow_dispatch: + inputs: + message: + description: 'Snapshot information (e.g. New Core Snapshot Tue Dec 15 00:07:18 UTC 2020 f212f54)' + required: true +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + java: ['8', '11'] + env: + WORKSPACE: ${{ github.workspace }} + GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8 + steps: + - name: Print Dispatch Information + if: github.event_name == 'workflow_dispatch' + env: + DISPATCH_INFORMATION: ${{ github.event.inputs.message }} + run: echo $DISPATCH_INFORMATION + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Optional setup step + run: | + [ -f ./setup.sh ] && ./setup.sh || true + - name: Run all tests (chromeHeadless) except spring-boot + run: ./gradlew -Dgeb.env=chromeHeadless check --no-daemon -x gorm-hibernate5-spring-boot:test + - name: Run Spring Boot Tests + run: ./gradlew gorm-hibernate5-spring-boot:test --no-daemon + - name: Publish Test Report + uses: scacap/action-surefire-report@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + report_paths: '**/build/test-results/test/TEST-*.xml' + - name: Publish to repo.grails.org + if: success() && github.event_name == 'push' && matrix.java == '8' + env: + SECRING_FILE: ${{ secrets.SECRING_FILE }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + run: | + echo $SECRING_FILE | base64 -d > secring.gpg + ./gradlew -Dorg.gradle.internal.publish.checksums.insecure=true -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="secring.gpg" publish + ./gradlew docs:docs + - name: Determine docs target repository + if: success() && github.event_name == 'push' && matrix.java == '8' + uses: haya14busa/action-cond@v1 + id: docs_target + with: + cond: ${{ github.repository == 'grails/gorm-hibernate5' }} + if_true: "grails/grails-data-mapping" + if_false: ${{ github.repository }} + - name: Publish to Github Pages + if: success() && github.event_name == 'push' && matrix.java == '8' + uses: micronaut-projects/github-pages-deploy-action@master + env: + TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} + BRANCH: gh-pages + FOLDER: docs/build/docs + DOC_SUB_FOLDER: hibernate + DOC_FOLDER: gh-pages + COMMIT_EMAIL: behlp@objectcomputing.com + COMMIT_NAME: Puneet Behl diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml new file mode 100644 index 0000000000..89f1e20ee8 --- /dev/null +++ b/.github/workflows/release-notes.yml @@ -0,0 +1,43 @@ +name: Changelog +on: + issues: + types: [closed,reopened] + push: + branches: + - master + - '[7-9]+.[0-9]+.x' +jobs: + release_notes: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Check if it has release drafter config file + id: check_release_drafter + run: | + has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false") + echo ::set-output name=has_release_drafter::${has_release_drafter} + + # If it has release drafter: + - uses: release-drafter/release-drafter@v5 + if: steps.check_release_drafter.outputs.has_release_drafter == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + # Otherwise: + - name: Export Gradle Properties + if: steps.check_release_drafter.outputs.has_release_drafter == 'false' + uses: micronaut-projects/github-actions/export-gradle-properties@master + - uses: micronaut-projects/github-actions/release-notes@master + if: steps.check_release_drafter.outputs.has_release_drafter == 'false' + id: release_notes + with: + token: ${{ secrets.GH_TOKEN }} + - uses: ncipollo/release-action@v1 + if: steps.check_release_drafter.outputs.has_release_drafter == 'false' && steps.release_notes.outputs.generated_changelog == 'true' + with: + allowUpdates: true + commit: ${{ steps.release_notes.outputs.current_branch }} + draft: true + name: ${{ env.title }} ${{ steps.release_notes.outputs.next_version }} + tag: v${{ steps.release_notes.outputs.next_version }} + bodyFile: CHANGELOG.md + token: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..13d8028b4c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,90 @@ +name: Release +on: + release: + types: [published] +jobs: + release: + runs-on: ubuntu-latest + strategy: + matrix: + java: ['8'] + env: + GIT_USER_NAME: puneetbehl + GIT_USER_EMAIL: behlp@objectcomputing.com + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + token: ${{ secrets.GH_TOKEN }} + - uses: gradle/wrapper-validation-action@v1 + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Set the current release version + id: release_version + run: echo ::set-output name=release_version::${GITHUB_REF:11} + - name: Run pre-release + uses: micronaut-projects/github-actions/pre-release@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Publish, Upload to Bintray + env: + BINTRAY_USER: ${{ secrets.BINTRAY_USER }} + BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} + run: | + echo "Publishing Artifacts" + ./gradlew bintrayUpload + echo "Publishing Documentation" + ./gradlew docs:docs + - name: Export Gradle Properties + uses: micronaut-projects/github-actions/export-gradle-properties@master + - name: Determine docs target repository + if: success() + uses: haya14busa/action-cond@v1 + id: docs_target + with: + cond: ${{ github.repository == 'grails/gorm-hibernate5' }} + if_true: "grails/grails-data-mapping" + if_false: ${{ github.repository }} + - name: Publish to Github Pages + if: success() + uses: micronaut-projects/github-pages-deploy-action@master + env: + BETA: ${{ contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }} + TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} + BRANCH: gh-pages + FOLDER: docs/build/docs + DOC_SUB_FOLDER: hibernate + DOC_FOLDER: gh-pages + COMMIT_EMAIL: behlp@objectcomputing.com + COMMIT_NAME: Puneet Behl + VERSION: ${{ steps.release_version.outputs.release_version }} + - name: Create Message for the Maven Central Sync + if: success() + id: maven_sync_message + run: | + echo ::set-output name=value::{\"release_version\":\"$RELEASE_VERSION\"} + env: + RELEASE_VERSION: ${{ steps.release_version.outputs.release_version }} + - name: Invoke the Maven Central Sync workflow + if: success() + uses: benc-uk/workflow-dispatch@v1.1 + with: + workflow: Maven Central Sync + ref: master + token: ${{ secrets.GH_TOKEN }} + inputs: ${{ steps.maven_sync_message.outputs.value }} + - name: Run post-release + if: success() + uses: micronaut-projects/github-actions/post-release@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + env: + SNAPSHOT_SUFFIX: .BUILD-SNAPSHOT diff --git a/.travis.yml b/.travis.yml index 7972ec4217..029b454a76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,6 @@ +branches: + only: + - 6.1.x addons: chrome: stable firefox: latest From 859d593295da9d1a8a0d279a6267756a75580b53 Mon Sep 17 00:00:00 2001 From: Puneet Behl Date: Thu, 4 Mar 2021 04:11:48 +0530 Subject: [PATCH 2/2] Extract project version in gradle.properties file --- build.gradle | 3 +-- gradle.properties | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 895a7d88e1..e0c26b0736 100644 --- a/build.gradle +++ b/build.gradle @@ -25,8 +25,7 @@ plugins { group "org.grails" -//version "7.0.5.RELEASE" -version "7.0.5.BUILD-SNAPSHOT" +version project.projectVersion logger.info("GORM VERSION = ${project.gormVersion}") ext { diff --git a/gradle.properties b/gradle.properties index 2ba482ca4e..e4cbd13ae5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,6 +11,7 @@ tomcatVersion=8.5.0 snakeyamlVersion=1.23 jaxbVersion=2.3.1 picocliVersion=3.8.0 +projectVersion=7.0.5.BUILD-SNAPSHOT jansiVersion=1.17.1 assetPipelineVersion=3.0.7 spockVersion=1.2-groovy-2.5