sbglasius commented on code in PR #15:
URL: 
https://github.com/apache/grails-gradle-publish/pull/15#discussion_r2429999022


##########
.github/workflows/release.yaml:
##########
@@ -115,7 +83,7 @@ jobs:
           NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }}
           NEXUS_PUBLISH_URL: 'https://repository.apache.org/service/local/'

Review Comment:
   Same...



##########
.github/workflows/release.yaml:
##########
@@ -129,7 +97,7 @@ jobs:
           NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }}
           NEXUS_PUBLISH_URL: 'https://repository.apache.org/service/local/'

Review Comment:
   DRY



##########
.github/workflows/release.yaml:
##########
@@ -54,59 +45,36 @@ jobs:
           echo "${{ secrets.GRAILS_GPG_KEY }}" | gpg --batch --import
           gpg --list-keys
       - name: "☕️ Setup JDK"
-        uses: actions/setup-java@v4
+        uses: actions/setup-java@v5
         with:
           distribution: liberica
           java-version: 17.0.14 # this must be a specific version for 
reproducible builds
       - name: "🐘 Setup Gradle"
-        uses: gradle/actions/setup-gradle@v4
+        uses: gradle/actions/setup-gradle@v5
         with:
           develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
-      - name: "📝 Store the target branch"
-        id: extract_branch
-        run: |
-          echo "Determining Target Branch"
-          TARGET_BRANCH=`cat $GITHUB_EVENT_PATH | jq 
'.release.target_commitish' | sed -e 's/^"\(.*\)"$/\1/g'`
-          echo $TARGET_BRANCH
-          echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT
       - name: "📝 Store the current release version"
         id: release_version
-        run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
+        env:
+          TAG_NAME: ${{ github.event.release.tag_name }}
+        run: echo "value=${TAG_NAME#v}" >> $GITHUB_OUTPUT
       - name: "⚙️ Run pre-release"
         uses: apache/grails-github-actions/pre-release@asf
         env:
           RELEASE_VERSION: ${{ steps.release_version.outputs.value }}
-      - name: "📝 Fetch release commit hash"
-        id: commit_hash
-        env:
-          OWNER: ${{ github.repository_owner }}
-          REPO: ${{ steps.extract_repository_name.outputs.repository_name }}
-          TAG: 'v${{ steps.release_version.outputs.value }}'
-          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        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 }}
       - name: "📦 Generate docs"
         run: >
           ./gradlew grails-publish:groovydoc
-          -PgithubBranch=${{ steps.extract_branch.outputs.value }}
       - name: "✨ Create Staging Repository"
         env:
           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/'

Review Comment:
   This really ought to be a secret / variable from the GH setup, that way a 
script is truly configurable - I know: Not now, but worth having in mind



##########
.github/workflows/release.yaml:
##########
@@ -306,19 +270,18 @@ jobs:
           fi
       - name: "📥 Fetch source distributions"
         run: |
-          export TAG="v${{ needs.publish.outputs.release_version }}"
+          export TAG="${{ github.event.release.tag_name }}"
           export VERSION="${{ needs.publish.outputs.release_version }}"
           cd dev-repo
           mkdir -p $VERSION/sources          
           cd $VERSION/sources
-          curl -f -LO https://github.com/apache/${{ 
needs.publish.outputs.extract_repository_name 
}}/releases/download/$TAG/apache-grails-publish-$VERSION-src.zip
-          curl -f -LO https://github.com/apache/${{ 
needs.publish.outputs.extract_repository_name 
}}/releases/download/$TAG/apache-grails-publish-$VERSION-src.zip.sha512
-          curl -f -LO https://github.com/apache/${{ 
needs.publish.outputs.extract_repository_name 
}}/releases/download/$TAG/apache-grails-publish-$VERSION-src.zip.asc
+          curl -f -LO https://github.com/${{ github.repository 
}}/releases/download/$TAG/apache-grails-publish-$VERSION-src.zip
+          curl -f -LO https://github.com/${{ github.repository 
}}/releases/download/$TAG/apache-grails-publish-$VERSION-src.zip.sha512
+          curl -f -LO https://github.com/${{ github.repository 
}}/releases/download/$TAG/apache-grails-publish-$VERSION-src.zip.asc

Review Comment:
   Yes. This is the way.
   



##########
.github/workflows/release.yaml:
##########
@@ -337,21 +300,23 @@ jobs:
           tag_name: ${{ github.event.release.tag_name }}
           files: dev-repo/DIST_SVN_REVISION.txt
       - name: "📥 Checkout repository"
-        uses: actions/checkout@v4
+        uses: actions/checkout@v5
         with:
           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: "📧 Print Grails Vote Email"
         env:
           VERSION: ${{ needs.publish.outputs.release_version }}
-          VERSION_COMMIT_ID: ${{ needs.publish.outputs.commit_hash }}
+          VERSION_COMMIT_ID: ${{ github.sha }}
         run: |
           export DIST_SVN_REVISION=$(awk '/Last Changed Rev:/ {print $4}' 
dev-repo/DIST_SVN_REVISION.txt)
           echo "::group::Grails PMC Vote Email"
+          echo ""

Review Comment:
   We talked about adding a "Recipients: " list with whom should receive this 
mail.



##########
.github/workflows/release.yaml:
##########
@@ -441,42 +398,30 @@ jobs:
       actions: write # in case there are pending changes to release.yml in the 
target branch
     steps:
       - name: "📥 Checkout repository"
-        uses: actions/checkout@v4
+        uses: actions/checkout@v5
         with:
           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
-        run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> 
"$GITHUB_ENV"
-      - name: "☕️ Setup JDK"
-        uses: actions/setup-java@v4
-        with:
-          distribution: liberica
-          java-version: 17
-      - name: "🐘 Setup Gradle"
-        uses: gradle/actions/setup-gradle@v4
-        with:
-          develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
       - name: "⚙️ Run post-release"
         uses: apache/grails-github-actions/post-release@asf
       - name: '🌎 Create Blog Post - MANUAL'
         run: |
           echo "::group::Blog Post Creation - MANUAL"
           echo "Publish a blog post on https://grails.apache.org/blog/ about 
the new release ${{ needs.publish.outputs.release_version }} using the repo 
https://github.com/apache/grails-static-website";
           echo "::endgroup::"
-      - name: 'Announcement Email'
+      - name: '✉️ Announcement Email'
         env:
           VERSION: ${{ needs.publish.outputs.release_version }}
-          VERSION_COMMIT_ID: ${{ needs.publish.outputs.commit_hash }}
           PREVIOUS_VERSION: 'TODO_PREVIOUS_VERSION'
         run: |
-          export DIST_SVN_REVISION=$(awk '/Last Changed Rev:/ {print $4}' 
dev-repo/DIST_SVN_REVISION.txt)
-
           echo "::group::Announcement Email"
+          echo ""

Review Comment:
   Also a "Recipient: " list here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to