From 3d3ca305976c9b1dfd3033c8c943c92f725de0f7 Mon Sep 17 00:00:00 2001 From: Jeff Scott Brown Date: Mon, 30 Sep 2024 09:18:18 -0500 Subject: [PATCH 1/7] Update gradle.yml Replacing TEMP_ARTIFACTORY_* names with ARTIFACTORY_*> --- .github/workflows/gradle.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index c992c160..7cc1c617 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -42,7 +42,7 @@ jobs: id: publish uses: gradle/gradle-build-action@v3 env: - ARTIFACTORY_USERNAME: ${{ secrets.TEMP_ARTIFACTORY_USERNAME }} - ARTIFACTORY_PASSWORD: ${{ secrets.TEMP_ARTIFACTORY_PASSWORD }} + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} with: - arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish \ No newline at end of file + arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish From 7b30721c31f2df732c4da3369a718706984b92e5 Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Thu, 3 Oct 2024 10:12:47 -0700 Subject: [PATCH 2/7] Match release.yml to scaffolding --- .github/workflows/release.yml | 183 +++++++++++++--------------------- 1 file changed, 68 insertions(+), 115 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 888032f6..a45d12f8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,122 +1,75 @@ name: Release on: - release: - types: [ published ] -permissions: - contents: write + release: + types: [published] jobs: - get-version: - name: Get version - runs-on: ubuntu-latest + release: + runs-on: ubuntu-latest + strategy: + matrix: + java: ['11'] + env: + GIT_USER_NAME: grails-build + GIT_USER_EMAIL: grails-build@users.noreply.github.com + steps: + - name: Checkout repository + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + with: + token: ${{ secrets.GH_TOKEN }} + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + 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: Generate secring file env: - GIT_USER_NAME: ${{ vars.GIT_USER_NAME }} - GIT_USER_EMAIL: ${{ vars.GIT_USER_EMAIL }} - outputs: - version: ${{ steps.get_version.outputs.version-without-v }} - next-patch-version: ${{ steps.version.outputs.inc-patch }} - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: dhkatz/get-version-action@v3.0.0 - id: get_version - - uses: madhead/semver-utils@latest - id: version - with: - version: ${{ steps.get_version.outputs.version-without-v }} - release: - name: Release to SONATYPE - runs-on: ubuntu-latest - needs: get-version + SECRING_FILE: ${{ secrets.SECRING_FILE }} + run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg + - name: Publish to Sonatype OSSRH + id: publish + uses: gradle/gradle-build-action@v3 env: - GIT_USER_NAME: ${{ vars.GIT_USER_NAME }} - GIT_USER_EMAIL: ${{ vars.GIT_USER_EMAIL }} - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: temurin - - uses: micronaut-projects/github-actions/pre-release@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Publish to Sonatype OSSRH - # if: ${{ false }} # prevent deploy - env: - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} - SECRING_FILE: ${{ secrets.SECRING_FILE }} - SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} - SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} - SIGNING_FILE: ${{ github.workspace }}/secring.pgp - RELEASE_VERSION: ${{ needs.get-version.outputs.version }} - run: | - echo "${SECRING_FILE}" | base64 -d > "${SIGNING_FILE}" - echo "Publishing Artifacts for $RELEASE_VERSION" - (set -x; ./gradlew -Pversion="${RELEASE_VERSION}" publishToSonatype closeAndReleaseSonatypeStagingRepository --no-daemon) - rm "${SIGNING_FILE}" - bump-snapshot-version: - runs-on: ubuntu-latest - needs: [ get-version, release ] + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }} + SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} + SECRING_FILE: ${{ secrets.SECRING_FILE }} + with: + arguments: -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository + - name: Run Assemble + id: assemble + if: steps.publish.outcome == 'success' + uses: gradle/gradle-build-action@v3 + with: + arguments: assemble + - name: Export Gradle Properties + uses: micronaut-projects/github-actions/export-gradle-properties@master + - name: Publish to Github Pages + if: steps.assemble.outcome == 'success' + uses: micronaut-projects/github-pages-deploy-action@master env: - GIT_USER_NAME: ${{ vars.GIT_USER_NAME }} - GIT_USER_EMAIL: ${{ vars.GIT_USER_EMAIL }} - NEXT_VERSION: ${{ needs.get-version.outputs.next-patch-version }} - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: temurin - - name: Set version in gradle.properties - run: | - echo "Preparing next snapshot as ${NEXT_VERSION}" - ./gradlew snapshotVersion -Pversion="${NEXT_VERSION}" - - uses: actions-js/push@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - author_name: ${{ vars.GIT_USER_NAME }} - author_email: $${ vars.GIT_USER_EMAIL }} - branch: master - message: Set project version to ${{ env.NEXT_VERSION }}-SNAPSHOT - documenation: - runs-on: ubuntu-latest - needs: [ get-version, release ] + BETA: ${{ contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }} + 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: ${{ env.GIT_USER_NAME }} + VERSION: ${{ steps.release_version.outputs.release_version }} + - name: Run post-release + if: success() + uses: micronaut-projects/github-actions/post-release@master + with: + token: ${{ secrets.GITHUB_TOKEN }} env: - GIT_USER_NAME: ${{ vars.GIT_USER_NAME }} - GIT_USER_EMAIL: ${{ vars.GIT_USER_EMAIL }} - RELEASE_VERSION: ${{ needs.get-version.outputs.version }} - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: temurin - - uses: micronaut-projects/github-actions/export-gradle-properties@master - id: asciidoctor - - uses: gradle/gradle-build-action@v2 - with: - arguments: -Pversion="${{ env.RELEASE_VERSION }}" asciidoctor - - uses: micronaut-projects/github-pages-deploy-action@master - if: success() - env: - BETA: false - TARGET_REPOSITORY: ${{ github.repository }} - GH_TOKEN: ${{ secrets.GH_TOKEN }} - BRANCH: gh-pages - FOLDER: build/asciidoc - DOC_FOLDER: latest - COMMIT_EMAIL: ${{ vars.GIT_USER_EMAIL }} - COMMIT_NAME: ${{ vars.GIT_USER_NAME }} - VERSION: ${{ env.RELEASE_VERSION }} - - uses: micronaut-projects/github-actions/post-release@master - if: success() - with: - token: ${{ secrets.GH_TOKEN }} + SNAPSHOT_SUFFIX: -SNAPSHOT From 9d4aca0145884dbb082f45f4668a998ea6cce829 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Thu, 3 Oct 2024 14:23:52 -0400 Subject: [PATCH 3/7] change version to projectVersion for use during release --- build.gradle | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index dcad513d..be1c6dc6 100644 --- a/build.gradle +++ b/build.gradle @@ -78,7 +78,7 @@ asciidoctor { 'compat-mode': 'true', 'toc': 'left', 'icons': 'font', - 'version': project.version, + 'version': project.projectVersion, 'sourcedir': 'src/main/groovy' baseDirFollowsSourceDir() outputDir = "${buildDir}/asciidoc" diff --git a/gradle.properties b/gradle.properties index 04320f23..60e95738 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ #Mon, 08 Apr 2024 19:48:24 +0000 -version=5.1.0-SNAPSHOT +projectVersion=5.1.0-SNAPSHOT grailsVersion=5.3.5 grailsGradlePluginVersion=5.3.1 grailsScaffoldingVersion=2.1.0 From f7b7833ad08905f0ea023f794175524e88cdc5a5 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Thu, 3 Oct 2024 14:31:06 -0400 Subject: [PATCH 4/7] add version project.projectVersion --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index be1c6dc6..9301a67f 100644 --- a/build.gradle +++ b/build.gradle @@ -13,6 +13,7 @@ plugins { id 'org.asciidoctor.jvm.convert' version '3.3.2' } +version project.projectVersion group 'org.grails.plugins' apply plugin: 'org.grails.grails-plugin' From 448b017f077724c9ec85ca161aa99fefa967a188 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Thu, 3 Oct 2024 14:57:38 -0400 Subject: [PATCH 5/7] add --stacktrace --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a45d12f8..97f12c48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} SECRING_FILE: ${{ secrets.SECRING_FILE }} with: - arguments: -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository + arguments: -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository --stacktrace - name: Run Assemble id: assemble if: steps.publish.outcome == 'success' From ea3c151b3c65b098515cf36bcf5f3d49dcafc96e Mon Sep 17 00:00:00 2001 From: James Fredley Date: Thu, 3 Oct 2024 17:30:47 -0400 Subject: [PATCH 6/7] Update to 5.1.1-SNAPSHOT --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 60e95738..d14e605f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ #Mon, 08 Apr 2024 19:48:24 +0000 -projectVersion=5.1.0-SNAPSHOT +projectVersion=5.1.1-SNAPSHOT grailsVersion=5.3.5 grailsGradlePluginVersion=5.3.1 grailsScaffoldingVersion=2.1.0 From 3fd72d99f9d4372edf4a1222f02b60560e1ba3dc Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Sat, 19 Oct 2024 16:53:21 -0700 Subject: [PATCH 7/7] scaffolding-core needs to be api dependency --- build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 9301a67f..7b4426c8 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,7 @@ buildscript { } plugins { id 'org.asciidoctor.jvm.convert' version '3.3.2' + id 'java-library' } version project.projectVersion @@ -38,7 +39,7 @@ dependencies { compileOnly "org.grails:grails-web-boot" compileOnly "org.grails:grails-dependencies" - implementation "org.grails:scaffolding-core:$grailsScaffoldingVersion" + api "org.grails:scaffolding-core:$grailsScaffoldingVersion" testImplementation "org.grails:grails-web-testing-support" testImplementation "org.grails:grails-gorm-testing-support"