matrei commented on code in PR #6:
URL:
https://github.com/apache/incubator-grails-gradle-publish/pull/6#discussion_r2254447237
##########
.github/workflows/release.yaml:
##########
@@ -179,86 +153,107 @@ jobs:
- name: "📥 Checkout repository"
uses: actions/checkout@v4
with:
- token: ${{ secrets.GITHUB_TOKEN }}
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 }} \
Review Comment:
This should work.
https://cli.github.com/manual/gh_release_delete-asset
--
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]