|
29 | 29 | run: bun install --frozen-lockfile |
30 | 30 |
|
31 | 31 | - name: Run update script |
32 | | - run: bun run scripts/update-links.ts |
| 32 | + run: COMPUTE_SHA256=true bun run scripts/update-links.ts |
33 | 33 | env: |
34 | 34 | NOTIFICATION_SECRET: ${{ secrets.NOTIFICATION_SECRET }} |
35 | 35 |
|
|
49 | 49 | git add --all |
50 | 50 | git commit -m "Update Cursor download links and version history" |
51 | 51 | git push |
| 52 | +
|
| 53 | + - name: Derive latest version |
| 54 | + id: latest |
| 55 | + if: steps.git-check.outputs.changes == 'true' |
| 56 | + run: | |
| 57 | + VERSION=$(jq -r '.versions[0].version' version-history.json) |
| 58 | + DATE=$(jq -r '.versions[0].date' version-history.json) |
| 59 | + echo "version=${VERSION}" >> $GITHUB_OUTPUT |
| 60 | + echo "date=${DATE}" >> $GITHUB_OUTPUT |
| 61 | +
|
| 62 | + - name: Build release notes |
| 63 | + id: notes |
| 64 | + if: steps.git-check.outputs.changes == 'true' |
| 65 | + run: | |
| 66 | + echo "Generating release notes for v${{ steps.latest.outputs.version }}" |
| 67 | + { |
| 68 | + echo "# Cursor v${{ steps.latest.outputs.version }}" |
| 69 | + echo "Released: ${{ steps.latest.outputs.date }}" |
| 70 | + echo |
| 71 | + echo "## Downloads" |
| 72 | + echo |
| 73 | + echo "| Platform | Link | Size | SHA256 |" |
| 74 | + echo "| --- | --- | --- | --- |" |
| 75 | + jq -r ' |
| 76 | + .versions[0] as $v | |
| 77 | + ($v.platforms | to_entries) as $p | |
| 78 | + ($v.platformDetails // {}) as $d | |
| 79 | + $p[] | .key as $k | .value as $u | |
| 80 | + ($d[$k].sizeBytes // null) as $sz | |
| 81 | + ($d[$k].sha256 // null) as $sha | |
| 82 | + [ $k, |
| 83 | + "[Download](" + $u + ")", |
| 84 | + (if $sz then ($sz|tonumber) else null end), |
| 85 | + (if $sha then ("`" + $sha + "`") else "-" end) |
| 86 | + ] | @tsv' |
| 87 | + version-history.json | |
| 88 | + awk -F"\t" '{ |
| 89 | + size=$3; unit=""; |
| 90 | + if (size=="") { printf "| %s | %s | - | %s |\n", $1,$2,$4; next } |
| 91 | + s=size+0; u[0]="B"; u[1]="KB"; u[2]="MB"; u[3]="GB"; i=0; |
| 92 | + while (s>=1024 && i<3) { s=s/1024; i++ } |
| 93 | + printf "| %s | %s | %.1f %s | %s |\n", $1,$2,s,u[i],$4; |
| 94 | + }' |
| 95 | + } > RELEASE_NOTES.md |
| 96 | + echo "path=RELEASE_NOTES.md" >> $GITHUB_OUTPUT |
| 97 | +
|
| 98 | + - name: Create GitHub release |
| 99 | + if: steps.git-check.outputs.changes == 'true' |
| 100 | + uses: softprops/action-gh-release@v2 |
| 101 | + with: |
| 102 | + tag_name: v${{ steps.latest.outputs.version }} |
| 103 | + name: Cursor v${{ steps.latest.outputs.version }} |
| 104 | + body_path: ${{ steps.notes.outputs.path }} |
| 105 | + env: |
| 106 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments