This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-parent.git


The following commit(s) were added to refs/heads/main by this push:
     new fc4e23b  Fix CI for optional `bin.zip`
fc4e23b is described below

commit fc4e23bd6dd17099a3f7952469dff54492300910
Author: Volkan Yazıcı <[email protected]>
AuthorDate: Wed Sep 6 09:58:37 2023 +0200

    Fix CI for optional `bin.zip`
---
 .github/workflows/deploy-release-reusable.yml | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/deploy-release-reusable.yml 
b/.github/workflows/deploy-release-reusable.yml
index de6d749..c7a021e 100644
--- a/.github/workflows/deploy-release-reusable.yml
+++ b/.github/workflows/deploy-release-reusable.yml
@@ -101,22 +101,32 @@ jobs:
       - name: Create the distribution
         if: startsWith(github.ref, 'refs/heads/release/')
         run: |
+
+          # Generate the distribution (i.e., `src.zip` and optional `bin.zip`)
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             --non-recursive -P distribution \
             -DattachmentFilepathPattern=${{ 
inputs.distribution-attachment-filepath-pattern }} \
             -DattachmentCount=${{ inputs.distribution-attachment-count }}
+
+          # Rename distribution files
           export DIST_FILENAME_PREFIX="apache-${{ inputs.project-name }}"
           export 
DIST_FILENAME_VERSIONED_PREFIX="${DIST_FILENAME_PREFIX}-${PROJECT_VERSION}"
           export DIST_FILEPATH_PREFIX="/tmp/${DIST_FILENAME_VERSIONED_PREFIX}"
           export DIST_FILEPATH_SRC="${DIST_FILEPATH_PREFIX}-src.zip"
           export DIST_FILEPATH_BIN="${DIST_FILEPATH_PREFIX}-bin.zip"
           mv "target/src.zip" "$DIST_FILEPATH_SRC"
-          mv "target/bin.zip" "$DIST_FILEPATH_BIN"
+          [ -e "$DIST_FILEPATH_SRC" ] && mv "target/bin.zip" 
"$DIST_FILEPATH_BIN"
+
+          # Create signature and checksum files
           for DIST_FILEPATH in "$DIST_FILEPATH_SRC" "$DIST_FILEPATH_BIN"; do
-            gpg --armor --detach-sign --yes --pinentry-mode error 
"$DIST_FILEPATH"
-            sha512sum "$DIST_FILEPATH" > "$DIST_FILEPATH.sha512"
+            if [ -e "$DIST_FILEPATH" ]; then
+              gpg --armor --detach-sign --yes --pinentry-mode error 
"$DIST_FILEPATH"
+              sha512sum "$DIST_FILEPATH" > "$DIST_FILEPATH.sha512"
+            fi
           done
+
+          # Pass the necessary environment variables
           cat >> $GITHUB_ENV << EOF
           DIST_FILENAME_PREFIX=$DIST_FILENAME_PREFIX
           DIST_FILENAME_VERSIONED_PREFIX=$DIST_FILENAME_VERSIONED_PREFIX

Reply via email to