This is an automated email from the ASF dual-hosted git repository. matrei pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/incubator-grails-gradle-publish.git
The following commit(s) were added to refs/heads/7.0.x by this push: new 1e2c76f Updates after move from `grails-core` (#6) 1e2c76f is described below commit 1e2c76f1fc1aa3a0812678192b7c07a92fefe55a Author: Mattias Reichel <mat...@apache.org> AuthorDate: Thu Aug 7 17:15:53 2025 +0200 Updates after move from `grails-core` (#6) * chore: update project after move Miscellaneous updates after project move from `grails-core` to its own repo. * chore: apply changes from feedback * chore(ci): some more token cleanup Clean up some more token params where it is already set by default in the actions used. * ci: add `GITHUB_TOKEN` to `actions/checkout` This should not be needed when checking out the "local" repository, but we have had problems with `Input required and not supplied: token` errors for this type of checkout. --- .asf.yaml | 2 +- .github/vote_templates/announce.txt | 8 +- .github/vote_templates/groovy_pmc.txt | 12 +- .github/vote_templates/staged.txt | 8 +- .github/workflows/ci.yaml | 37 +++--- .github/workflows/rat.yaml | 20 ++- .github/workflows/release.yaml | 230 ++++++++++++++++------------------ build.gradle | 14 +-- gradle-bootstrap/build.gradle | 14 +-- gradle/signing-config.gradle | 9 +- settings.gradle | 8 +- 11 files changed, 179 insertions(+), 183 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index 2ef1db5..4926cfb 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -3,7 +3,7 @@ github: issues: true projects: true discussions: true - description: "Apache Grails (incubating) - Gradle Plugin - Grails Publish" + description: "Apache Grails (incubating) - Grails Publish Gradle Plugin" homepage: https://grails.apache.org/ labels: - gradle-plugin diff --git a/.github/vote_templates/announce.txt b/.github/vote_templates/announce.txt index 2c7f1e1..c422dd9 100644 --- a/.github/vote_templates/announce.txt +++ b/.github/vote_templates/announce.txt @@ -1,8 +1,8 @@ -The Apache Grails (incubating) community is pleased to announce the release of Apache Grails (incubating) - Gradle Plugin - Grails Publish ${VERSION}. +The Apache Grails (incubating) community is pleased to announce the release of Apache Grails (incubating) - Grails Publish Gradle Plugin ${VERSION}. -The Grails Publish Gradle Plugin is a tool that simplifies the process of publishing Grails related artifacts to various repository types - making it easier for developers to share their work with the community. +The Grails Publish Gradle Plugin is a tool that simplifies the process of publishing Grails-related artifacts to various repository types - making it easier for developers to share their work with the community. -This release is another milestone on our journey to a final 7.0 release for all of the Grails ecosystem. Users are encouraged to try the milestone to provide early feedback. Detailed instructions are available here: https://github.com/apache/incubator-grails-gradle-publish. +Users are encouraged to try the milestone to provide early feedback. Detailed instructions are available here: https://github.com/apache/incubator-grails-gradle-publish. For the complete list of changes: https://github.com/apache/incubator-grails-gradle-publish/compare/v${PREVIOUS_VERSION}...v${VERSION} @@ -12,7 +12,7 @@ Apache Grails website: https://grails.apache.org/ Download Links: https://grails.apache.org/download.html Grails Resources: -- Grails Publish GitHub repo: https://github.com/apache/incubator-grails-gradle-publish +- Grails Publish Gradle Plugin GitHub repo: https://github.com/apache/incubator-grails-gradle-publish - Issues: https://github.com/apache/incubator-grails-gradle-publish/issues - Mailing lists: https://grails.apache.org/community.html diff --git a/.github/vote_templates/groovy_pmc.txt b/.github/vote_templates/groovy_pmc.txt index ef6eb93..2327086 100644 --- a/.github/vote_templates/groovy_pmc.txt +++ b/.github/vote_templates/groovy_pmc.txt @@ -1,7 +1,7 @@ Hi Everyone, -The Apache Grails community has voted to approve the release of the Apache Grails Gradle Plugin - Grails Publish ${VERSION}. +The Apache Grails community has voted to approve the release of the Apache Grails (incubating) Publish Gradle Plugin ${VERSION}. -As the incubation host, we now kindly request the Groovy PMC to review & approve our ASF release. +As the incubation host, we now kindly request the Groovy PMC to review and approve this release. Grails vote thread: * <VOTE THREAD LINK> @@ -19,12 +19,12 @@ Binary distributions: https://dist.apache.org/repos/dist/dev/incubator/grails/gr Release artifacts are signed with a key from the following file: https://dist.apache.org/repos/dist/release/incubator/grails/KEYS -Please vote on releasing this package as Apache Grails (incubating) - Gradle Plugin - Grails Publish ${VERSION}. +Please vote on releasing this package as Apache Grails (incubating) Grails Publish Gradle Plugin ${VERSION}. Hints on validating checksums/signatures (but replace md5sum with sha512sum): https://www.apache.org/info/verification.html -The vote for this release is open for the next 72 hours. -[ ] +1 Release Apache Grails (incubating) - Gradle Plugin - Grails Publish ${VERSION} +The vote for this release is open for a minimum of 72 hours. +[ ] +1 Release Apache Grails (incubating) - Grails Publish Gradle Plugin ${VERSION} [ ] 0 I don't have a strong opinion about this, but I assume it's ok -[ ] -1 Do not release Apache Grails (incubating) - Gradle Plugin - Grails Publish ${VERSION} because... +[ ] -1 Do not release Apache Grails (incubating) - Grails Publish Gradle Plugin ${VERSION} because... diff --git a/.github/vote_templates/staged.txt b/.github/vote_templates/staged.txt index a92b518..e4ab79b 100644 --- a/.github/vote_templates/staged.txt +++ b/.github/vote_templates/staged.txt @@ -19,7 +19,7 @@ Binary distributions: https://dist.apache.org/repos/dist/dev/incubator/grails/gr Release artifacts are signed with a key from the following file: https://dist.apache.org/repos/dist/release/incubator/grails/KEYS -Please vote on releasing this package as Apache Grails (incubating) - Gradle Plugin - Grails Publish ${VERSION}. +Please vote on releasing this package as Apache Grails (incubating) - Grails Publish Gradle Plugin ${VERSION}. Reminder on ASF release approval requirements for PPMC members: https://www.apache.org/legal/release-policy.html#release-approval @@ -27,12 +27,12 @@ https://www.apache.org/legal/release-policy.html#release-approval Hints on validating checksums/signatures (but replace md5sum with sha512sum): https://www.apache.org/info/verification.html -The vote is open for the next 72 hours and passes if a majority of at least +The vote is open for a minimum of 72 hours and passes if a majority of at least three +1 PPMC votes are cast. -[ ] +1 Release Apache Grails (incubating) - Gradle Plugin - Grails Publish ${VERSION} +[ ] +1 Release Apache Grails (incubating) - Grails Publish Gradle Plugin ${VERSION} [ ] 0 I don't have a strong opinion about this, but I assume it's ok -[ ] -1 Do not release Apache Grails (incubating) - Gradle Plugin - Grails Publish ${VERSION} because... +[ ] -1 Do not release Apache Grails (incubating) - Grails Publish Gradle Plugin ${VERSION} because... Here is my vote: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 415a67b..361c04c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,7 +17,7 @@ name: "CI" on: push: branches: - - '[4-9]+.[0-9]+.x' + - '[0-9]+.[0-9]+.x' pull_request: workflow_dispatch: # queue jobs and only allow 1 run per branch due to the likelihood of hitting GitHub resource limits @@ -26,14 +26,14 @@ concurrency: cancel-in-progress: false jobs: build: - name: 'Build' + name: "Build Project" strategy: fail-fast: false matrix: java: [ 17, 21 ] runs-on: ubuntu-24.04 steps: - - name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it + - name: "🌐 Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it run: curl -s https://api.ipify.org - name: "📥 Checkout repository" uses: actions/checkout@v4 @@ -45,25 +45,28 @@ jobs: - name: "🐘 Setup Gradle" uses: gradle/actions/setup-gradle@v4 with: - develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} - - name: "🔨 Build project without tests" + develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} + - name: "🔨 Build Project (without tests)" if: ${{ contains(github.event.head_commit.message, '[skip tests]') }} run: > ./gradlew build - --continue --stacktrace -PskipTests - - name: "🔨 Build project with tests" + -PskipTests + --continue + --stacktrace + - name: "🔨 Build and Test Project" if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }} run: > ./gradlew build - --continue --stacktrace + --continue + --stacktrace --rerun-tasks publish: if: github.repository_owner == 'apache' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') - name: 'Publish' + name: 'Publish Snapshot Artifacts' needs: [ build ] runs-on: ubuntu-24.04 steps: - - name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it + - name: "🌐 Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it run: curl -s https://api.ipify.org - name: "📥 Checkout repository" uses: actions/checkout@v4 @@ -75,8 +78,8 @@ jobs: - name: "🐘 Setup Gradle" uses: gradle/actions/setup-gradle@v4 with: - develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} - - name: "📤 Publish Gradle Snapshot Artifacts" + develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} + - name: "📤 Publish Snapshot Artifacts" env: GRAILS_PUBLISH_RELEASE: 'false' MAVEN_PUBLISH_URL: 'https://repository.apache.org/content/repositories/snapshots' @@ -84,7 +87,9 @@ jobs: MAVEN_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PW }} run: > ./gradlew publish aggregateChecksums aggregatePublishedArtifacts - -Dorg.gradle.internal.publish.checksums.insecure=true --no-build-cache --rerun-tasks + --no-build-cache + --rerun-tasks + -Dorg.gradle.internal.publish.checksums.insecure=true - name: "📤 Upload checksums" uses: actions/upload-artifact@v4 with: @@ -96,8 +101,10 @@ jobs: name: PUBLISHED_ARTIFACTS.txt path: build/PUBLISHED_ARTIFACTS.txt - name: "🔨 Generate Snapshot Documentation" - run: ./gradlew grails-publish:groovydoc -PgithubBranch=${{ needs.publish.outputs.target_branch }} - - name: "🚀 Publish to Github Pages" + run: > + ./gradlew grails-publish:groovydoc + -PgithubBranch=${{ needs.publish.outputs.target_branch }} + - name: "🚀 Publish Snapshot Documentation to Github Pages" uses: apache/grails-github-actions/deploy-github-pages@asf env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/rat.yaml b/.github/workflows/rat.yaml index 51a8f4d..480020c 100644 --- a/.github/workflows/rat.yaml +++ b/.github/workflows/rat.yaml @@ -17,22 +17,18 @@ name: "Licensing - RAT Report" on: push: branches: - - '[4-9]+.[0-9]+.x' - - '[3-9]+.[3-9]+.x' - - license-audit + - '[0-9]+.[0-9]+.x' pull_request: branches: - - '[4-9]+.[0-9]+.x' - - '[3-9]+.[3-9]+.x' - - license-audit + - '[0-9]+.[0-9]+.x' workflow_dispatch: -# queue jobs and only allow 1 run per branch due to the likelihood of hitting GitHub resource limits +# Queue jobs and only allow 1 run per branch due to the likelihood of hitting GitHub resource limits concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: false jobs: rat-audit: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: "📥 Checkout repository" uses: actions/checkout@v4 @@ -44,16 +40,16 @@ jobs: - name: "🐘 Setup Gradle" uses: gradle/actions/setup-gradle@v4 with: - develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} + develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} - name: "🧐 Apache License - Release Audit Tool" run: ./gradlew rat - - name: Upload RAT HTML report + - name: "📤 Upload RAT HTML report" if: always() - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@v4 with: name: rat-report path: build/reports/rat/index.html - - name: Publish RAT report in Job Summary + - name: "📤 Publish RAT report in Job Summary" if: always() run: | echo "## 📋 Apache RAT Report" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 59cc2d2..6a74303 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -19,13 +19,13 @@ on: types: [ published ] permissions: { } env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GRAILS_PUBLISH_RELEASE: 'true' jobs: publish: - name: "Stage Files" + name: "Stage Artifacts for Release" permissions: - contents: write # to create release & upload wrapper - issues: write # to modify milestones + contents: write # to stage distributions to the GitHub release page + issues: write # to modify milestones runs-on: ubuntu-24.04 outputs: release_version: ${{ steps.release_version.outputs.value }} @@ -33,39 +33,35 @@ jobs: target_branch: ${{ steps.extract_branch.outputs.value }} extract_repository_name: ${{ steps.extract_repository_name.outputs.repository_name }} steps: - - name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it + - name: "🌐 Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it run: curl -s https://api.ipify.org - - name: "Extract repository name" + - name: "📝 Extract repository name" id: extract_repository_name - run: | - echo "repository_name=${GITHUB_REPOSITORY##*/}" >> $GITHUB_OUTPUT + run: echo "repository_name=${GITHUB_REPOSITORY##*/}" >> $GITHUB_OUTPUT - name: "📥 Checkout repository" uses: actions/checkout@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} # This should not be needed as ${{ github.token }} is the default, but there have been issues with it. ref: ${{ github.ref }} fetch-depth: 1 fetch-tags: true - - name: 'Ensure Common Build Date' # to ensure a reproducible build + - name: "📅 Store common build date" # to ensure a reproducible build run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> "$GITHUB_ENV" - - name: "Ensure source files use common date" - run: | - find . -depth \( -type f -o -type d \) -exec touch -d "@${SOURCE_DATE_EPOCH}" {} + - - name: '🔐 Set up GPG' + - name: "📅 Ensure source files use common date" + run: find . -depth \( -type f -o -type d \) -exec touch -d "@${SOURCE_DATE_EPOCH}" {} + + - name: "🔐 Set up GPG for signing" run: | echo "${{ secrets.GRAILS_GPG_KEY }}" | gpg --batch --import gpg --list-keys - env: - GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} - name: "☕️ Setup JDK" uses: actions/setup-java@v4 with: distribution: liberica - java-version: '17.0.14' # this must be a specific version for reproducible builds + java-version: 17.0.14 # this must be a specific version for reproducible builds - name: "🐘 Setup Gradle" uses: gradle/actions/setup-gradle@v4 with: - develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} + develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} - name: "📝 Store the target branch" id: extract_branch run: | @@ -76,12 +72,11 @@ jobs: - name: "📝 Store the current release version" id: release_version run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT - - name: '⚙️ Run pre-release' + - name: "⚙️ Run pre-release" uses: apache/grails-github-actions/pre-release@asf env: RELEASE_VERSION: ${{ steps.release_version.outputs.value }} - RELEASE_SCRIPT_PATH: '.github/scripts/setReleasedGrailsVersion.sh' - - name: 'Fetch release Commit Hash' + - name: "📝 Fetch release commit hash" id: commit_hash env: OWNER: ${{ github.repository_owner }} @@ -89,39 +84,32 @@ jobs: TAG: 'v${{ steps.release_version.outputs.value }}' run: | ref_json=$(gh api "repos/$OWNER/$REPO/git/ref/tags/$TAG") - type=$(jq -r '.object.type' <<<"$ref_json") sha=$(jq -r '.object.sha' <<<"$ref_json") - if [ "$type" = "tag" ]; then sha=$(gh api "repos/$OWNER/$REPO/git/tags/$sha" --jq '.object.sha') fi - echo "Found Commit Sha: $sha" - echo "value=$sha" >>"$GITHUB_OUTPUT" - name: "🧩 Run Assemble" - run: ./gradlew assemble -PgithubBranch=${{ steps.extract_branch.outputs.value }} - env: - GRAILS_PUBLISH_RELEASE: "true" + run: > + ./gradlew assemble + -PgithubBranch=${{ steps.extract_branch.outputs.value }} - name: "📦 Generate docs" - run: ./gradlew grails-publish:groovydoc -PgithubBranch=${{ steps.extract_branch.outputs.value }} - env: - GRAILS_PUBLISH_RELEASE: "true" - - name: "Create Staging Repository" + run: > + ./gradlew grails-publish:groovydoc + -PgithubBranch=${{ steps.extract_branch.outputs.value }} + - name: "✨ Create Staging Repository" env: - GRAILS_PUBLISH_RELEASE: "true" NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }} NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }} NEXUS_PUBLISH_URL: 'https://repository.apache.org/service/local/' NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.STAGING_PROFILE_ID }} NEXUS_PUBLISH_DESCRIPTION: '${{ steps.extract_repository_name.outputs.repository_name }}:${{ steps.release_version.outputs.value }}' SIGNING_KEY: ${{ secrets.GPG_KEY_ID }} - run: > - ./gradlew initializeSonatypeStagingRepository + run: ./gradlew initializeSonatypeStagingRepository - name: "📤 Publish" env: - GRAILS_PUBLISH_RELEASE: 'true' NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }} NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }} NEXUS_PUBLISH_URL: 'https://repository.apache.org/service/local/' @@ -129,15 +117,13 @@ jobs: NEXUS_PUBLISH_DESCRIPTION: '${{ steps.extract_repository_name.outputs.repository_name }}:${{ steps.release_version.outputs.value }}' SIGNING_KEY: ${{ secrets.GPG_KEY_ID }} run: > - ./gradlew - -x initializeSonatypeStagingRepository - findSonatypeStagingRepository + ./gradlew findSonatypeStagingRepository publishToSonatype aggregateChecksums aggregatePublishedArtifacts - - name: "📤 Close Staging Repository" + -x initializeSonatypeStagingRepository + - name: "✅ Close Staging Repository" env: - GRAILS_PUBLISH_RELEASE: 'true' NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }} NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }} NEXUS_PUBLISH_URL: 'https://repository.apache.org/service/local/' @@ -145,30 +131,18 @@ jobs: NEXUS_PUBLISH_DESCRIPTION: '${{ steps.extract_repository_name.outputs.repository_name }}:${{ steps.release_version.outputs.value }}' SIGNING_KEY: ${{ secrets.GPG_KEY_ID }} run: > - ./gradlew - -x initializeSonatypeStagingRepository - findSonatypeStagingRepository + ./gradlew findSonatypeStagingRepository closeSonatypeStagingRepository - - name: "Upload checksums" - uses: softprops/action-gh-release@v2 - with: - files: build/CHECKSUMS.txt - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: "Upload published artifacts" - uses: softprops/action-gh-release@v2 - with: - files: build/PUBLISHED_ARTIFACTS.txt - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: "Generate Build Date file" + -x initializeSonatypeStagingRepository + - name: "📅 Generate build date file" run: echo "$SOURCE_DATE_EPOCH" >> build/BUILD_DATE.txt - - name: "Upload Build Date file" + - name: "📤 Upload build date, checksums and published artifacts files" uses: softprops/action-gh-release@v2 with: - files: build/BUILD_DATE.txt - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + files: | + build/BUILD_DATE.txt + build/CHECKSUMS.txt + build/PUBLISHED_ARTIFACTS.txt source: name: "Create Source Distribution" needs: publish @@ -179,86 +153,108 @@ jobs: - name: "📥 Checkout repository" uses: actions/checkout@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} # This should not be needed as ${{ github.token }} is the default, but there have been issues with it. ref: v${{ needs.publish.outputs.release_version }} - path: "grails-publish" + path: 'grails-publish' - name: "🗑️ Remove unnecessary files" run: | - rm -f grails-publish/gradle/wrapper/gradle-wrapper.jar - rm -f grails-publish/gradle/wrapper/gradle-wrapper.properties - rm -f grails-publish/gradlew - - name: "Download CHECKSUMS.txt and rename to CHECKSUMS" - working-directory: "grails-publish" + rm -f \ + grails-publish/gradle/wrapper/gradle-wrapper.jar \ + grails-publish/gradle/wrapper/gradle-wrapper.properties \ + grails-publish/gradlew.bat \ + grails-publish/gradlew + - name: "📥 Download CHECKSUMS.txt and rename to CHECKSUMS" + working-directory: 'grails-publish' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | release_url=$(gh release view v${{ needs.publish.outputs.release_version }} --json assets --repo ${{ github.repository }} --jq '.assets[] | select(.name == "CHECKSUMS.txt") | .url') curl -L -H "Authorization: token $GH_TOKEN" -o CHECKSUMS "$release_url" - - name: "Download PUBLISHED_ARTIFACTS.txt and rename to PUBLISHED_ARTIFACTS" - working-directory: "grails-publish" + - name: "📥 Download PUBLISHED_ARTIFACTS.txt and rename to PUBLISHED_ARTIFACTS" + working-directory: 'grails-publish' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | release_url=$(gh release view v${{ needs.publish.outputs.release_version }} --json assets --repo ${{ github.repository }} --jq '.assets[] | select(.name == "PUBLISHED_ARTIFACTS.txt") | .url') curl -L -H "Authorization: token $GH_TOKEN" -o PUBLISHED_ARTIFACTS "$release_url" - - name: "Download BUILD_DATE.txt and rename to BUILD_DATE" - working-directory: "grails-publish" + - name: "📥 Download BUILD_DATE.txt and rename to BUILD_DATE" + working-directory: 'grails-publish' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | release_url=$(gh release view v${{ needs.publish.outputs.release_version }} --json assets --repo ${{ github.repository }} --jq '.assets[] | select(.name == "BUILD_DATE.txt") | .url') curl -L -H "Authorization: token $GH_TOKEN" -o BUILD_DATE "$release_url" - - name: "Ensure source files use common date" + - name: "📅 Ensure source files use common date" run: | SOURCE_DATE_EPOCH=$(cat grails-publish/BUILD_DATE) find . -depth \( -type f -o -type d \) -exec touch -d "@${SOURCE_DATE_EPOCH}" {} + - name: "📦 Create source distribution ZIP" run: | - zip -r "apache-grails-publish-${{ needs.publish.outputs.release_version }}-incubating-src.zip" grails-publish -x 'grails-publish/.git/*' -x 'grails-publish/.github/*' - - name: '🔐 Set up GPG' + zip -r \ + "apache-grails-publish-${{ needs.publish.outputs.release_version }}-incubating-src.zip" \ + grails-publish \ + -x 'grails-publish/.git/*' \ + -x 'grails-publish/.github/*' + - name: '🔐 Set up GPG for signing artifacts' run: | echo "${{ secrets.GRAILS_GPG_KEY }}" | gpg --batch --import gpg --list-keys - env: - GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} - name: "🔏 Sign source distribution ZIP" - env: - GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} run: | - gpg --default-key "${GPG_KEY_ID}" --batch --yes --pinentry-mode loopback --armor --detach-sign apache-grails-publish-${{ needs.publish.outputs.release_version }}-incubating-src.zip + gpg \ + --default-key "${{ secrets.GPG_KEY_ID }}" \ + --batch \ + --yes \ + --pinentry-mode loopback \ + --armor \ + --detach-sign apache-grails-publish-${{ needs.publish.outputs.release_version }}-incubating-src.zip - name: "📦 Create source distribution checksum" run: | - sha512sum apache-grails-publish-${{ needs.publish.outputs.release_version }}-incubating-src.zip > "apache-grails-publish-${{ needs.publish.outputs.release_version }}-incubating-src.zip.sha512" + sha512sum "apache-grails-publish-${{ needs.publish.outputs.release_version }}-incubating-src.zip" \ + > "apache-grails-publish-${{ needs.publish.outputs.release_version }}-incubating-src.zip.sha512" - name: "🚀 Upload ZIP and Signature to GitHub Release" uses: softprops/action-gh-release@v2 with: tag_name: v${{ needs.publish.outputs.release_version }} files: | apache-grails-publish-${{ needs.publish.outputs.release_version }}-incubating-src.zip - apache-grails-publish-${{ needs.publish.outputs.release_version }}-incubating-src.zip.sha512 apache-grails-publish-${{ needs.publish.outputs.release_version }}-incubating-src.zip.asc - - name: "Remove CHECKSUMS.txt asset from release" - working-directory: "grails-publish" + apache-grails-publish-${{ needs.publish.outputs.release_version }}-incubating-src.zip.sha512 + - name: "🗑️ Remove CHECKSUMS.txt asset from release" + working-directory: 'grails-publish' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -e - gh release --repo ${{ github.repository }} delete-asset v${{ needs.publish.outputs.release_version }} CHECKSUMS.txt --yes - - name: "Remove BUILD_DATE.txt asset from release" - working-directory: "grails-publish" + gh release delete-asset \ + v${{ needs.publish.outputs.release_version }} \ + CHECKSUMS.txt \ + --repo ${{ github.repository }} \ + --yes + - name: "🗑️ Remove BUILD_DATE.txt asset from release" + working-directory: 'grails-publish' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -e - gh release --repo ${{ github.repository }} delete-asset v${{ needs.publish.outputs.release_version }} BUILD_DATE.txt --yes - - name: "Remove PUBLISHED_ARTIFACTS.txt asset from release" - working-directory: "grails-publish" + gh release delete-asset \ + v${{ needs.publish.outputs.release_version }} \ + BUILD_DATE.txt \ + --repo ${{ github.repository }} \ + --yes + - name: "🗑️ Remove PUBLISHED_ARTIFACTS.txt asset from release" + working-directory: 'grails-publish' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -e - gh release --repo ${{ github.repository }} delete-asset v${{ needs.publish.outputs.release_version }} PUBLISHED_ARTIFACTS.txt --yes + gh release delete-asset \ + v${{ needs.publish.outputs.release_version }} \ + PUBLISHED_ARTIFACTS.txt \ + --repo ${{ github.repository }} \ + --yes upload: + name: "Upload Source Distribution" needs: [ publish, source ] runs-on: ubuntu-24.04 permissions: @@ -267,14 +263,13 @@ jobs: SVN_USERNAME: ${{ secrets.SVC_DIST_GRAILS_USERNAME }} SVN_PASSWORD: ${{ secrets.SVC_DIST_GRAILS_PASSWORD }} steps: - - name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it + - name: "🌐 Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it run: curl -s https://api.ipify.org - - name: "Setup SVN and Tools" + - name: "⚙️ Setup SVN and Tools" run: sudo apt-get install -y subversion subversion-tools tree gettext-base - - name: "Ensure grails dev folder exists" + - name: "👀 Ensure grails dev folder exists" run: | set -e - if svn ls https://dist.apache.org/repos/dist/dev/incubator/grails --username "$SVN_USERNAME" --password "$SVN_PASSWORD" --non-interactive; then echo "Dev Folder 'grails' already exists — skipping creation" else @@ -283,10 +278,9 @@ jobs: mkdir https://dist.apache.org/repos/dist/dev/incubator/grails \ -m "Create 'grails' dev folder" fi - - name: "Ensure grails publish folder exists" + - name: "👀 Ensure grails publish folder exists" run: | set -e - if svn ls https://dist.apache.org/repos/dist/dev/incubator/grails/grails-publish --username "$SVN_USERNAME" --password "$SVN_PASSWORD" --non-interactive; then echo "Dev Folder 'grails/grails-publish' already exists — skipping creation" else @@ -295,10 +289,10 @@ jobs: mkdir https://dist.apache.org/repos/dist/dev/incubator/grails/grails-publish \ -m "Create 'grails-publish' dev folder" fi - - name: "Checkout dev repo" + - name: "📥 Checkout dev repo" run: | svn checkout --username "$SVN_USERNAME" --password "$SVN_PASSWORD" --non-interactive https://dist.apache.org/repos/dist/dev/incubator/grails/grails-publish dev-repo - - name: "Remove existing dev version" + - name: "🗑️ Remove existing dev version" run: | export VERSION="${{ needs.publish.outputs.release_version }}" cd dev-repo @@ -308,7 +302,7 @@ jobs: else echo "No existing dev version $VERSION to remove" fi - - name: "Fetch source distributions" + - name: "📥 Fetch source distributions" run: | export TAG="v${{ needs.publish.outputs.release_version }}" export VERSION="${{ needs.publish.outputs.release_version }}" @@ -320,24 +314,22 @@ jobs: curl -LO https://github.com/apache/grails-core/releases/download/$TAG/apache-grails-publish-$VERSION-incubating-src.zip.asc echo "Downloaded the following files:" ls -l - - name: "Store Distribution SVN revision" + - name: "💾 Store Distribution SVN revision in a file" run: | export VERSION="${{ needs.publish.outputs.release_version }}" cd dev-repo svn info $VERSION > "DIST_SVN_REVISION.txt" - - name: "Upload Distribution SVN revision" + - name: "📤 Upload the Distribution SVN revision file" uses: softprops/action-gh-release@v2 with: files: dev-repo/DIST_SVN_REVISION.txt - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: "📥 Checkout repository" uses: actions/checkout@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} # This should not be needed as ${{ github.token }} is the default, but there have been issues with it. ref: v${{ needs.publish.outputs.release_version }} - path: "grails-publish" - - name: 'Initial Vote Email' + path: 'grails-publish' + - name: "📧 Print Grails Vote Email" env: VERSION: ${{ needs.publish.outputs.release_version }} VERSION_COMMIT_ID: ${{ needs.publish.outputs.commit_hash }} @@ -349,9 +341,9 @@ jobs: echo "*************************************************" echo "Body:" echo "*************************************************" - cat grails-core/.github/vote_templates/staged.txt | envsubst + cat grails-publish/.github/vote_templates/staged.txt | envsubst echo "*************************************************" - - name: 'Groovy Vote Email' + - name: '📧 Print Groovy Vote Email' env: VERSION: ${{ needs.publish.outputs.release_version }} VERSION_COMMIT_ID: ${{ needs.publish.outputs.commit_hash }} @@ -363,7 +355,7 @@ jobs: echo "*************************************************" echo "Body:" echo "*************************************************" - cat grails-core/.github/vote_templates/groovy_pmc.txt | envsubst + cat grails-publish/.github/vote_templates/groovy_pmc.txt | envsubst echo "*************************************************" - name: 'Announcement Email' env: @@ -378,7 +370,7 @@ jobs: echo "*************************************************" echo "Body:" echo "*************************************************" - cat grails-core/.github/vote_templates/announce.txt | envsubst + cat grails-publish/.github/vote_templates/announce.txt | envsubst echo "*************************************************" docs: environment: docs @@ -389,10 +381,10 @@ jobs: - name: "📥 Checkout repository" uses: actions/checkout@v4 with: + token: ${{ secrets.GITHUB_TOKEN }} # This should not be needed as ${{ github.token }} is the default, but there have been issues with it. fetch-depth: 0 # need the full history to find all tags - token: ${{ secrets.GITHUB_TOKEN }} ref: v${{ needs.publish.outputs.release_version }} - - name: 'Ensure Common Build Date' # to ensure a reproducible build + - name: "📅 Ensure Common Build Date" # to ensure a reproducible build run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> "$GITHUB_ENV" - name: "☕️ Setup JDK" uses: actions/setup-java@v4 @@ -404,9 +396,9 @@ jobs: with: develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} - name: "📖 Generate Documentation" - run: ./gradlew grails-publish:groovydoc -PgithubBranch=${{ needs.publish.outputs.target_branch }} - env: - GRAILS_PUBLISH_RELEASE: 'true' + run: > + ./gradlew grails-publish:groovydoc + -PgithubBranch=${{ needs.publish.outputs.target_branch }} - name: "🚀 Publish to Github Pages" uses: apache/grails-github-actions/deploy-github-pages@asf env: @@ -427,9 +419,9 @@ jobs: - name: "📥 Checkout repository" uses: actions/checkout@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} # This should not be needed as ${{ github.token }} is the default, but there have been issues with it. ref: v${{ needs.publish.outputs.release_version }} - - name: 'Ensure Common Build Date' # to ensure a reproducible build + - name: "📅 Ensure Common Build Date" # to ensure a reproducible build run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> "$GITHUB_ENV" - name: "☕️ Setup JDK" uses: actions/setup-java@v4 @@ -439,6 +431,6 @@ jobs: - name: "🐘 Setup Gradle" uses: gradle/actions/setup-gradle@v4 with: - develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} + develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} - name: "⚙️ Run post-release" uses: apache/grails-github-actions/post-release@asf diff --git a/build.gradle b/build.gradle index 82c1843..20cfaac 100644 --- a/build.gradle +++ b/build.gradle @@ -27,19 +27,15 @@ allprojects { } } +def buildInstant = java.util.Optional.ofNullable(System.getenv('SOURCE_DATE_EPOCH')) + .filter(s -> !s.isEmpty()) + .map(Long::parseLong) + .map(Instant::ofEpochSecond) + .orElseGet(Instant::now) as Instant ext { - buildInstant = java.util.Optional.ofNullable(System.getenv("SOURCE_DATE_EPOCH")) - .filter(s -> !s.isEmpty()) - .map(Long::parseLong) - .map(Instant::ofEpochSecond) - .orElseGet(Instant::now) formattedBuildDate = DateTimeFormatter.ISO_INSTANT.format(buildInstant) buildDate = (buildInstant as Instant).atZone(ZoneOffset.UTC) // for reproducible builds - isReleaseVersion = Boolean.parseBoolean(System.getenv('GRAILS_PUBLISH_RELEASE')) - ext.'signing.keyId' = project.findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY') - ext.'signing.password' = project.findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE') - ext.'signing.secretKeyRingFile' = project.findProperty('signing.secretKeyRingFile') ?: "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg" isCiBuild = System.getenv().containsKey('CI') configuredTestParallel = findProperty('maxTestParallel') as Integer ?: (isCiBuild ? 3 : Runtime.runtime.availableProcessors() * 3 / 4 as int ?: 1) } diff --git a/gradle-bootstrap/build.gradle b/gradle-bootstrap/build.gradle index 0313e49..63eb882 100644 --- a/gradle-bootstrap/build.gradle +++ b/gradle-bootstrap/build.gradle @@ -25,14 +25,14 @@ tasks.withType(Wrapper).configureEach { gradleVersion = props.gradle } -defaultTasks 'bootstrap' +defaultTasks('bootstrap') tasks.register('bootstrap') { - dependsOn 'wrapper' + dependsOn('wrapper') doLast { - ant.move file: "${projectDir}/gradlew", todir: "${projectDir}/../" - ant.move file: "${projectDir}/gradlew.bat", todir: "${projectDir}/../" - ant.move file: "${projectDir}/gradle/wrapper", todir: "${projectDir}/../gradle" - ant.chmod(file: "${projectDir}/../gradlew", perm: '755') - ant.chmod(file: "${projectDir}/../gradlew.bat", perm: '755') + ant.move(file: "$projectDir/gradlew", todir: "$projectDir/../") + ant.move(file: "$projectDir/gradlew.bat", todir: "$projectDir/../") + ant.move(file: "$projectDir/gradle/wrapper", todir: "$projectDir/../gradle") + ant.chmod(file: "$projectDir/../gradlew", perm: '755') + ant.chmod(file: "$projectDir/../gradlew.bat", perm: '755') } } diff --git a/gradle/signing-config.gradle b/gradle/signing-config.gradle index 1172d4f..5af6051 100644 --- a/gradle/signing-config.gradle +++ b/gradle/signing-config.gradle @@ -19,8 +19,13 @@ import io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository if (isReleaseVersion) { + apply plugin: 'signing' + ext.set('signing.keyId', findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY')) + ext.set('signing.password', findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE')) + ext.set('signing.secretKeyRingFile', findProperty('signing.secretKeyRingFile') ?: "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg") + afterEvaluate { signing { required { isReleaseVersion && gradle.taskGraph.hasTask('publish') } @@ -36,7 +41,7 @@ if (isReleaseVersion) { onlyIf { isReleaseVersion } } - project.rootProject.tasks.withType(InitializeNexusStagingRepository).configureEach { InitializeNexusStagingRepository task -> - task.shouldRunAfter = project.tasks.withType(Sign) + rootProject.tasks.withType(InitializeNexusStagingRepository).configureEach { + shouldRunAfter = tasks.withType(Sign) } } diff --git a/settings.gradle b/settings.gradle index 24eb8a2..01a1a66 100644 --- a/settings.gradle +++ b/settings.gradle @@ -18,8 +18,8 @@ */ plugins { - id 'com.gradle.develocity' version '4.0.1' - id 'com.gradle.common-custom-user-data-gradle-plugin' version '2.2.1' + id 'com.gradle.develocity' version '4.1' + id 'com.gradle.common-custom-user-data-gradle-plugin' version '2.3' } def isCI = System.getenv().containsKey('CI') @@ -28,7 +28,7 @@ def isReproducibleBuild = System.getenv('SOURCE_DATE_EPOCH') != null if (isReproducibleBuild) { gradle.settingsEvaluated { logger.warn('*************** Remote Build Cache Disabled due to Reproducible Build ********************') - logger.warn("Build date will be set to (SOURCE_DATE_EPOCH=${System.getenv("SOURCE_DATE_EPOCH")})") + logger.warn('Build date will be set to (SOURCE_DATE_EPOCH={})', System.getenv('SOURCE_DATE_EPOCH')) } } @@ -36,7 +36,7 @@ develocity { server = 'https://ge.grails.org' buildScan { tag('grails') - tag('grails-gradle-plugins') + tag('grails-publish-gradle-plugin') publishing.onlyIf { it.authenticated } uploadInBackground = isLocal }