@@ -211,6 +211,9 @@ jobs:
211
211
runs-on : ubuntu-22.04
212
212
213
213
steps :
214
+ - name : Checkout code
215
+ uses : actions/checkout@v2
216
+
214
217
- name : Get version
215
218
shell : bash
216
219
run : echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
@@ -220,18 +223,66 @@ jobs:
220
223
with :
221
224
path : artifacts
222
225
223
- - name : Prepare release files
226
+ - name : Calculate SHA256 checksums
224
227
run : |
225
- cd artifacts
226
- echo "Contents of artifacts directory:"
227
- ls -la
228
- echo "Contents of subdirectories:"
229
- ls -la */
228
+ mkdir -p checksums
229
+ for file in artifacts/CursorFreeVIP_${{ env.VERSION }}_windows.exe/CursorFreeVIP_${{ env.VERSION }}_windows.exe \
230
+ artifacts/CursorFreeVIP_${{ env.VERSION }}_mac_arm64/CursorFreeVIP_${{ env.VERSION }}_mac_arm64 \
231
+ artifacts/CursorFreeVIP_${{ env.VERSION }}_linux_x64/CursorFreeVIP_${{ env.VERSION }}_linux_x64 \
232
+ artifacts/CursorFreeVIP_${{ env.VERSION }}_linux_arm64/CursorFreeVIP_${{ env.VERSION }}_linux_arm64 \
233
+ artifacts/CursorFreeVIP_${{ env.VERSION }}_mac_intel/CursorFreeVIP_${{ env.VERSION }}_mac_intel
234
+ do
235
+ if [ -f "$file" ]; then
236
+ filename=$(basename $file)
237
+ sha256sum "$file" | cut -d ' ' -f 1 > checksums/${filename}.sha256
238
+ echo "${filename}: $(cat checksums/${filename}.sha256)" >> checksums/all_checksums.txt
239
+ else
240
+ echo "Warning: File $file not found"
241
+ fi
242
+ done
243
+ cat checksums/all_checksums.txt
244
+
245
+ - name : Extract release notes from CHANGELOG
246
+ run : |
247
+ version_pattern="## v${{ env.VERSION }}"
248
+ next_version_pattern="## v"
249
+
250
+ # Find the start line number of the current version
251
+ start_line=$(grep -n "$version_pattern" CHANGELOG.md | head -1 | cut -d: -f1)
252
+
253
+ if [ -z "$start_line" ]; then
254
+ echo "Error: Version ${{ env.VERSION }} not found in CHANGELOG.md"
255
+ exit 1
256
+ fi
230
257
258
+ # Find the line number of the next version
259
+ next_version_line=$(tail -n +$((start_line + 1)) CHANGELOG.md | grep -n "$next_version_pattern" | head -1 | cut -d: -f1)
260
+
261
+ if [ -z "$next_version_line" ]; then
262
+ # If there's no next version, get to the end of the file
263
+ changelog_content=$(tail -n +$start_line CHANGELOG.md)
264
+ else
265
+ # Extract content between current version and next version
266
+ end_line=$((start_line + next_version_line - 1))
267
+ changelog_content=$(sed -n "${start_line},${end_line}p" CHANGELOG.md)
268
+ fi
269
+
270
+ # Create release notes file
271
+ {
272
+ echo "$changelog_content"
273
+ echo ""
274
+ echo "## SHA256 Checksums"
275
+ cat checksums/all_checksums.txt
276
+ } > release_notes.md
277
+
278
+ # Display release notes for debugging
279
+ cat release_notes.md
280
+
231
281
- name : Create Release
232
282
uses : softprops/action-gh-release@v1
233
283
with :
234
284
tag_name : v${{ env.VERSION }}
285
+ body_path : release_notes.md
235
286
files : |
236
287
artifacts/CursorFreeVIP_${{ env.VERSION }}_windows.exe/CursorFreeVIP_${{ env.VERSION }}_windows.exe
237
288
artifacts/CursorFreeVIP_${{ env.VERSION }}_mac_arm64/CursorFreeVIP_${{ env.VERSION }}_mac_arm64
0 commit comments