Skip to content

Commit ae53f31

Browse files
committed
Improve artifact inspection, checksums, and diff links
Added a step to list downloaded artifacts after merging. Enhanced checksum generation with error handling for missing archives. Refactored release notes to generate the "Full diff" URL dynamically based on tag presence. #10
1 parent 9fbea43 commit ae53f31

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,30 @@ jobs:
112112
path: ${{ env.ARTIFACT_DIR }}
113113
merge-multiple: true
114114

115+
- name: Inspect downloaded artifacts
116+
shell: bash
117+
run: |
118+
set -euo pipefail
119+
echo "Contents of ${{ env.ARTIFACT_DIR }}:"
120+
find "${{ env.ARTIFACT_DIR }}" -maxdepth 2 -type f | sort
121+
115122
- name: Generate checksum files
123+
shell: bash
116124
run: |
117-
cd ${{ env.ARTIFACT_DIR }}
118-
for i in *.zip *.tar.gz; do
119-
[ -f "$i" ] && sha256sum -b "$i" > "$i.sha256"
125+
set -euo pipefail
126+
cd "${{ env.ARTIFACT_DIR }}"
127+
128+
shopt -s nullglob
129+
files=( *.zip *.tar.gz )
130+
131+
if [ ${#files[@]} -eq 0 ]; then
132+
echo "No release archives were downloaded into ${PWD}"
133+
ls -la
134+
exit 1
135+
fi
136+
137+
for i in "${files[@]}"; do
138+
sha256sum -b "$i" > "$i.sha256"
120139
done
121140
122141
- name: Build release notes
@@ -131,9 +150,11 @@ jobs:
131150
if [ -z "$PREV_TAG" ]; then
132151
RANGE="HEAD"
133152
PREV_LABEL="initial commit"
153+
DIFF_URL="https://github.com/${{ github.repository }}/commits/${VERSION}"
134154
else
135155
RANGE="${PREV_TAG}..HEAD"
136156
PREV_LABEL="${PREV_TAG}"
157+
DIFF_URL="https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${VERSION}"
137158
fi
138159
139160
COMMIT_COUNT=$(git rev-list $RANGE --count)
@@ -170,7 +191,7 @@ jobs:
170191
echo "|---|---|"
171192
echo "| **Released** | $(date -u +'%B %d, %Y') |"
172193
echo "| **Commits** | ${COMMIT_COUNT} since \`${PREV_LABEL}\` |"
173-
echo "| **Full diff** | [${{ github.repository }}](https://github.com/${{ github.repository }}/compare/${PREV_LABEL}...${VERSION}) |"
194+
echo "| **Full diff** | [${{ github.repository }}](${DIFF_URL}) |"
174195
echo ""
175196
echo "---"
176197
echo ""

0 commit comments

Comments
 (0)