|
18 | 18 | steps: |
19 | 19 | - name: Checkout code |
20 | 20 | uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + fetch-depth: 0 # Fetch all history for changelog generation |
21 | 23 |
|
22 | 24 | - name: Set up Python |
23 | 25 | uses: actions/setup-python@v5 |
|
45 | 47 | echo "VERSION=$version" >> $env:GITHUB_OUTPUT |
46 | 48 | echo "Version: $version" |
47 | 49 | |
| 50 | + - name: Generate release notes |
| 51 | + id: release_notes |
| 52 | + run: | |
| 53 | + $tag = "v${{ steps.version.outputs.VERSION }}" |
| 54 | + |
| 55 | + # Get the previous tag |
| 56 | + $previousTag = git describe --tags --abbrev=0 HEAD^ 2>$null |
| 57 | + |
| 58 | + if ($previousTag) { |
| 59 | + # Generate commit log between tags |
| 60 | + $commits = git log "$previousTag..HEAD" --pretty=format:"- %s (%h)" --no-merges |
| 61 | + } else { |
| 62 | + # First release - show recent commits |
| 63 | + $commits = git log -10 --pretty=format:"- %s (%h)" --no-merges |
| 64 | + } |
| 65 | + |
| 66 | + $releaseNotes = @" |
| 67 | + ## What's Changed |
| 68 | + |
| 69 | + $commits |
| 70 | + |
| 71 | + **Full Changelog**: https://github.com/${{ github.repository }}/compare/$previousTag...$tag |
| 72 | + "@ -replace "`r`n", "`n" |
| 73 | + |
| 74 | + # Escape for GitHub Actions |
| 75 | + $releaseNotes = $releaseNotes -replace '%', '%25' -replace "`n", '%0A' -replace "`r", '%0D' |
| 76 | + echo "NOTES=$releaseNotes" >> $env:GITHUB_OUTPUT |
| 77 | + |
48 | 78 | - name: Create version info file |
49 | 79 | run: | |
50 | 80 | @" |
|
82 | 112 | dotnet tool install -g vpk |
83 | 113 | vpk download github --repoUrl https://github.com/${{ github.repository }} --token ${{ secrets.GITHUB_TOKEN }} |
84 | 114 | vpk pack --packId ChiselPDF --packVersion ${{ steps.version.outputs.VERSION }} --packDir .\dist\ChiselPDF --mainExe ChiselPDF.exe |
85 | | - vpk upload github --repoUrl https://github.com/${{ github.repository }} --publish --releaseName "ChiselPDF ${{ steps.version.outputs.VERSION }}" --tag v${{ steps.version.outputs.VERSION }} --token ${{ secrets.GITHUB_TOKEN }} |
| 115 | + vpk upload github --repoUrl https://github.com/${{ github.repository }} --publish --releaseName "ChiselPDF ${{ steps.version.outputs.VERSION }}" --tag v${{ steps.version.outputs.VERSION }} --releaseNotes "${{ steps.release_notes.outputs.NOTES }}" --token ${{ secrets.GITHUB_TOKEN }} |
0 commit comments