From 6c0dc3932a833abb39fc6f1ae4b579cdf00b7588 Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Thu, 12 Dec 2024 18:16:51 -0800 Subject: [PATCH 1/9] Allows pre-release maven central retrieval of github artifacts --- .github/workflows/gradle.yml | 4 ++++ .github/workflows/release.yml | 4 ++++ build.gradle | 12 +++++++++++- gradle.properties | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 13e0f81a90..a5e1075f1c 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -25,6 +25,8 @@ jobs: - name: "🔨 Run Build" id: build env: + GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} DEVELOCITY_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 }} @@ -53,6 +55,8 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: "📤 Publish Snapshot to repo.grails.org" env: + GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} DEVELOCITY_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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef9ab90977..6d95983b4e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,6 +34,8 @@ jobs: with: arguments: assemble env: + GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} DEVELOCITY_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 }} @@ -51,6 +53,8 @@ jobs: id: publish uses: gradle/gradle-build-action@v3 env: + GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} DEVELOCITY_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 }} diff --git a/build.gradle b/build.gradle index b6e5ee8205..e159277a99 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ ext.set('signing.password', project.findProperty('signing.password') ?: System.g apply plugin: 'idea' -allprojects { +allprojects { prj -> repositories { mavenCentral() maven { url = 'https://repo.grails.org/grails/core' } @@ -40,6 +40,16 @@ allprojects { url = 'https://repository.apache.org/content/repositories/snapshots' } } + if (System.getenv("GITHUB_ACTOR") && System.getenv("GH_TOKEN") + && prj.name == 'grails-plugin-gsp' && !sitemeshVersion.endsWith('-SNAPSHOT')) { + maven { + url = 'https://maven.pkg.github.com/codeconsolegrails-plugin-sitemesh3' + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GH_TOKEN") + } + } + } } } diff --git a/gradle.properties b/gradle.properties index 976bbc94af..2fb15bed51 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ groovyVersion=4.0.24 jspApiVersion=4.0.0 jstlVersion=3.0.1 servletApiVersion=6.0.0 -sitemeshVersion=7.0.0-SNAPSHOT +sitemeshVersion=7.0.0-M1 controllersRef=https://docs.grails.org/latest/ref/Controllers commandLineRef=https://docs.grails.org/latest/ref/Command%20Line grailsDocsVersion=7.0.0-SNAPSHOT From bbb2f00bc8e3f563e0a3a275c9afd23cbf0edf96 Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Thu, 12 Dec 2024 18:54:26 -0800 Subject: [PATCH 2/9] Tests --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index e159277a99..036fd537ee 100644 --- a/build.gradle +++ b/build.gradle @@ -40,6 +40,7 @@ allprojects { prj -> url = 'https://repository.apache.org/content/repositories/snapshots' } } + println "Check 1:${System.getenv('GITHUB_ACTOR')?.size()} 2:${System.getenv('GH_TOKEN')?.size()} 3:${prj.name == 'grails-plugin-gsp'?:'skip'} 4:${!sitemeshVersion.endsWith('-SNAPSHOT')} 5:${System.getenv('DEVELOCITY_BUILD_CACHE_NODE_USER')?.size()}" if (System.getenv("GITHUB_ACTOR") && System.getenv("GH_TOKEN") && prj.name == 'grails-plugin-gsp' && !sitemeshVersion.endsWith('-SNAPSHOT')) { maven { From 4eb4bda4f82ae23425a624a133d7fe60410fc04e Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Fri, 13 Dec 2024 10:44:05 -0500 Subject: [PATCH 3/9] Correct maven url --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 036fd537ee..b124f0055e 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,7 @@ allprojects { prj -> if (System.getenv("GITHUB_ACTOR") && System.getenv("GH_TOKEN") && prj.name == 'grails-plugin-gsp' && !sitemeshVersion.endsWith('-SNAPSHOT')) { maven { - url = 'https://maven.pkg.github.com/codeconsolegrails-plugin-sitemesh3' + url = 'https://maven.pkg.github.com/codeconsole/grails-plugin-sitemesh3' credentials { username = System.getenv("GITHUB_ACTOR") password = System.getenv("GH_TOKEN") From 98cf4bd9af82d5d6be992e75f1053de77451c022 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Fri, 13 Dec 2024 10:49:30 -0500 Subject: [PATCH 4/9] Updating to force connection --- .github/workflows/gradle.yml | 2 ++ .github/workflows/release.yml | 2 ++ build.gradle | 5 ++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index a5e1075f1c..1b4938d00f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -27,6 +27,7 @@ jobs: env: GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} GH_TOKEN: ${{ secrets.GH_TOKEN }} + CHECK_BY_TOKEN: true DEVELOCITY_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 }} @@ -57,6 +58,7 @@ jobs: env: GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} GH_TOKEN: ${{ secrets.GH_TOKEN }} + CHECK_BY_TOKEN: true DEVELOCITY_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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d95983b4e..4051999257 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,6 +36,7 @@ jobs: env: GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} GH_TOKEN: ${{ secrets.GH_TOKEN }} + CHECK_BY_TOKEN: true DEVELOCITY_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 }} @@ -55,6 +56,7 @@ jobs: env: GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} GH_TOKEN: ${{ secrets.GH_TOKEN }} + CHECK_BY_TOKEN: true DEVELOCITY_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 }} diff --git a/build.gradle b/build.gradle index b124f0055e..477639c98c 100644 --- a/build.gradle +++ b/build.gradle @@ -40,9 +40,8 @@ allprojects { prj -> url = 'https://repository.apache.org/content/repositories/snapshots' } } - println "Check 1:${System.getenv('GITHUB_ACTOR')?.size()} 2:${System.getenv('GH_TOKEN')?.size()} 3:${prj.name == 'grails-plugin-gsp'?:'skip'} 4:${!sitemeshVersion.endsWith('-SNAPSHOT')} 5:${System.getenv('DEVELOCITY_BUILD_CACHE_NODE_USER')?.size()}" - if (System.getenv("GITHUB_ACTOR") && System.getenv("GH_TOKEN") - && prj.name == 'grails-plugin-gsp' && !sitemeshVersion.endsWith('-SNAPSHOT')) { + println "Check 1:${System.getenv("CHECK_BY_TOKEN")} 2:${prj.name == 'grails-plugin-gsp'?:'skip'} 3:${!sitemeshVersion.endsWith('-SNAPSHOT')}" + if (System.getenv("CHECK_BY_TOKEN") == "true" && prj.name == 'grails-plugin-gsp' && !sitemeshVersion.endsWith('-SNAPSHOT')) { maven { url = 'https://maven.pkg.github.com/codeconsole/grails-plugin-sitemesh3' credentials { From 7f017c4f669831e97dc9a6ba1313d39693a430ad Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Fri, 13 Dec 2024 11:00:19 -0500 Subject: [PATCH 5/9] Cleanup --- .github/workflows/gradle.yml | 10 ++++------ .github/workflows/release.yml | 10 ++++------ build.gradle | 9 +++++---- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 1b4938d00f..236719a726 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -25,9 +25,8 @@ jobs: - name: "🔨 Run Build" id: build env: - GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} - GH_TOKEN: ${{ secrets.GH_TOKEN }} - CHECK_BY_TOKEN: true + SITEMESH_MAVEN_PASSWORD: ${{ secrets.GH_TOKEN }} + CHECK_SITEMESH_REPO: true DEVELOCITY_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 }} @@ -56,9 +55,8 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: "📤 Publish Snapshot to repo.grails.org" env: - GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} - GH_TOKEN: ${{ secrets.GH_TOKEN }} - CHECK_BY_TOKEN: true + SITEMESH_MAVEN_PASSWORD: ${{ secrets.GH_TOKEN }} + CHECK_SITEMESH_REPO: true DEVELOCITY_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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4051999257..924299d908 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,9 +34,8 @@ jobs: with: arguments: assemble env: - GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} - GH_TOKEN: ${{ secrets.GH_TOKEN }} - CHECK_BY_TOKEN: true + SITEMESH_MAVEN_PASSWORD: ${{ secrets.GH_TOKEN }} + CHECK_SITEMESH_REPO: true DEVELOCITY_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 }} @@ -54,9 +53,8 @@ jobs: id: publish uses: gradle/gradle-build-action@v3 env: - GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} - GH_TOKEN: ${{ secrets.GH_TOKEN }} - CHECK_BY_TOKEN: true + SITEMESH_MAVEN_PASSWORD: ${{ secrets.GH_TOKEN }} + CHECK_SITEMESH_REPO: true DEVELOCITY_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 }} diff --git a/build.gradle b/build.gradle index 477639c98c..8579b22fd4 100644 --- a/build.gradle +++ b/build.gradle @@ -40,13 +40,14 @@ allprojects { prj -> url = 'https://repository.apache.org/content/repositories/snapshots' } } - println "Check 1:${System.getenv("CHECK_BY_TOKEN")} 2:${prj.name == 'grails-plugin-gsp'?:'skip'} 3:${!sitemeshVersion.endsWith('-SNAPSHOT')}" - if (System.getenv("CHECK_BY_TOKEN") == "true" && prj.name == 'grails-plugin-gsp' && !sitemeshVersion.endsWith('-SNAPSHOT')) { + + if (System.getenv("CHECK_SITEMESH_REPO") && prj.name == 'grails-plugin-gsp' && !sitemeshVersion.endsWith('-SNAPSHOT')) { + System.out.println("Adding Sitemesh Repo") maven { url = 'https://maven.pkg.github.com/codeconsole/grails-plugin-sitemesh3' credentials { - username = System.getenv("GITHUB_ACTOR") - password = System.getenv("GH_TOKEN") + username = 'DOES_NOT_MATTER' + password = System.getenv("SITEMESH_MAVEN_PASSWORD") } } } From c463d086ed3df7db66fa90d59d6d5c86940a4076 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Fri, 13 Dec 2024 11:11:16 -0500 Subject: [PATCH 6/9] Trying to get pull requests working with authentications to maven repo --- .github/workflows/gradle.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0d22ce362a..86cd20fef3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -7,6 +7,9 @@ on: branches: - '[3-9]+.[0-9]+.x' workflow_dispatch: +permissions: + contents: read + packages: read jobs: build: runs-on: ubuntu-latest @@ -27,7 +30,7 @@ jobs: - name: "🔨 Run Build" id: build env: - SITEMESH_MAVEN_PASSWORD: ${{ secrets.GH_TOKEN }} + SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} CHECK_SITEMESH_REPO: true run: ./gradlew build --refresh-dependencies - name: "📤 Upload Artifact" @@ -56,7 +59,7 @@ jobs: develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - name: "📤 Publish Snapshot to repo.grails.org" env: - SITEMESH_MAVEN_PASSWORD: ${{ secrets.GH_TOKEN }} + SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} CHECK_SITEMESH_REPO: true ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} From 7432ec11c4cc5c6137a115d2cd71e7eae1aa35a6 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Fri, 13 Dec 2024 11:17:02 -0500 Subject: [PATCH 7/9] Fix remaining github repo reads --- .github/workflows/gradle.yml | 8 +++++--- .github/workflows/groovy-joint-workflow.yml | 3 +++ .github/workflows/release.yml | 9 +++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 86cd20fef3..4fe7cab133 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -7,14 +7,12 @@ on: branches: - '[3-9]+.[0-9]+.x' workflow_dispatch: -permissions: - contents: read - packages: read jobs: build: runs-on: ubuntu-latest permissions: contents: read + packages: read steps: - name: "📥 Checkout the repository" uses: actions/checkout@v4 @@ -45,6 +43,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read + packages: read steps: - name: "📥 Checkout the repository" uses: actions/checkout@v4 @@ -70,6 +69,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + packages: read steps: - name: "📥 Checkout the repository" uses: actions/checkout@v4 @@ -89,6 +89,8 @@ jobs: if: steps.docs.outcome == 'success' uses: grails/github-pages-deploy-action@v2 env: + SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + CHECK_SITEMESH_REPO: true TARGET_REPOSITORY: ${{ github.repository }} GH_TOKEN: ${{ secrets.GH_TOKEN }} BRANCH: gh-pages diff --git a/.github/workflows/groovy-joint-workflow.yml b/.github/workflows/groovy-joint-workflow.yml index a92e70766b..7518318ced 100644 --- a/.github/workflows/groovy-joint-workflow.yml +++ b/.github/workflows/groovy-joint-workflow.yml @@ -9,6 +9,7 @@ on: workflow_dispatch: permissions: contents: read + packages: read jobs: build_groovy: runs-on: ubuntu-latest @@ -136,6 +137,8 @@ jobs: run: sed -i 's|// mavenLocal() // Keep|mavenLocal() // Keep|' build.gradle - name: "🔨 Build and test project using the locally built Groovy snapshot" env: + SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + CHECK_SITEMESH_REPO: true 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: > diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 73f5be2367..ab591f727f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,9 @@ jobs: outputs: release_version: ${{ steps.release_version.outputs.value }} runs-on: ubuntu-latest + permissions: + contents: read + packages: read steps: - name: Checkout repository uses: actions/checkout@v4 @@ -64,6 +67,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read + packages: read steps: - name: "📥 Checkout repository" uses: actions/checkout@v4 @@ -80,6 +84,8 @@ jobs: develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - name: "🚀 Release Sonatype Staging Repository" env: + SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + CHECK_SITEMESH_REPO: true SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} @@ -95,6 +101,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + packages: read steps: - name: "📥 Checkout repository" uses: actions/checkout@v4 @@ -115,6 +122,8 @@ jobs: if: success() uses: micronaut-projects/github-pages-deploy-action@grails env: + SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + CHECK_SITEMESH_REPO: true BETA: ${{ contains(needs.publish.outputs.release_version, 'M') || contains(needs.publish.outputs.release_version, 'RC') }} GH_TOKEN: ${{ secrets.GH_TOKEN }} BRANCH: gh-pages From 5482c8fffeb8b5aec6425685686bd31f366a7802 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Fri, 13 Dec 2024 11:27:53 -0500 Subject: [PATCH 8/9] Remove CHECK_SITEMESH_REPO --- .github/workflows/gradle.yml | 3 --- .github/workflows/groovy-joint-workflow.yml | 1 - .github/workflows/release.yml | 4 ---- build.gradle | 2 +- 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 4fe7cab133..7c411fee94 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -29,7 +29,6 @@ jobs: id: build env: SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - CHECK_SITEMESH_REPO: true run: ./gradlew build --refresh-dependencies - name: "📤 Upload Artifact" if: success() @@ -59,7 +58,6 @@ jobs: - name: "📤 Publish Snapshot to repo.grails.org" env: SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - CHECK_SITEMESH_REPO: true ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} run: ./gradlew publish @@ -90,7 +88,6 @@ jobs: uses: grails/github-pages-deploy-action@v2 env: SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - CHECK_SITEMESH_REPO: true TARGET_REPOSITORY: ${{ github.repository }} GH_TOKEN: ${{ secrets.GH_TOKEN }} BRANCH: gh-pages diff --git a/.github/workflows/groovy-joint-workflow.yml b/.github/workflows/groovy-joint-workflow.yml index 7518318ced..d577fce715 100644 --- a/.github/workflows/groovy-joint-workflow.yml +++ b/.github/workflows/groovy-joint-workflow.yml @@ -138,7 +138,6 @@ jobs: - name: "🔨 Build and test project using the locally built Groovy snapshot" env: SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - CHECK_SITEMESH_REPO: true 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: > diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab591f727f..9f0340f1a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,6 @@ jobs: run: ./gradlew assemble env: SITEMESH_MAVEN_PASSWORD: ${{ secrets.GH_TOKEN }} - CHECK_SITEMESH_REPO: true - name: "📤 Upload Distribution" if: success() uses: actions/upload-artifact@v4 @@ -50,7 +49,6 @@ jobs: id: publish env: SITEMESH_MAVEN_PASSWORD: ${{ secrets.GH_TOKEN }} - CHECK_SITEMESH_REPO: true SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} @@ -85,7 +83,6 @@ jobs: - name: "🚀 Release Sonatype Staging Repository" env: SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - CHECK_SITEMESH_REPO: true SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} @@ -123,7 +120,6 @@ jobs: uses: micronaut-projects/github-pages-deploy-action@grails env: SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - CHECK_SITEMESH_REPO: true BETA: ${{ contains(needs.publish.outputs.release_version, 'M') || contains(needs.publish.outputs.release_version, 'RC') }} GH_TOKEN: ${{ secrets.GH_TOKEN }} BRANCH: gh-pages diff --git a/build.gradle b/build.gradle index 8579b22fd4..62b11a0c10 100644 --- a/build.gradle +++ b/build.gradle @@ -41,7 +41,7 @@ allprojects { prj -> } } - if (System.getenv("CHECK_SITEMESH_REPO") && prj.name == 'grails-plugin-gsp' && !sitemeshVersion.endsWith('-SNAPSHOT')) { + if (System.getenv("SITEMESH_MAVEN_PASSWORD") && prj.name == 'grails-plugin-gsp' && !sitemeshVersion.endsWith('-SNAPSHOT')) { System.out.println("Adding Sitemesh Repo") maven { url = 'https://maven.pkg.github.com/codeconsole/grails-plugin-sitemesh3' From 3f13663fc0c6a28ee53f8c13806729627ff7ae99 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Fri, 13 Dec 2024 11:34:27 -0500 Subject: [PATCH 9/9] Set sitemesh password on the correct step --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f0340f1a8..5efece6c47 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,12 +114,13 @@ jobs: with: develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - name: "📖 Generate documentation" + env: + SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} run: ./gradlew docs - name: "📤 Publish documentation to Github Pages" if: success() uses: micronaut-projects/github-pages-deploy-action@grails env: - SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} BETA: ${{ contains(needs.publish.outputs.release_version, 'M') || contains(needs.publish.outputs.release_version, 'RC') }} GH_TOKEN: ${{ secrets.GH_TOKEN }} BRANCH: gh-pages