|
65 | 65 | needs: version |
66 | 66 | runs-on: ${{ matrix.os }} |
67 | 67 | strategy: |
| 68 | + fail-fast: false |
68 | 69 | matrix: |
69 | 70 | include: |
70 | 71 | - os: windows-latest |
|
97 | 98 | $rid='${{ matrix.rid }}' |
98 | 99 | $workspace='${{ github.workspace }}' |
99 | 100 | $outDir = Join-Path $workspace (Join-Path 'publish' $rid) |
100 | | - Write-Host "Publishing for $rid (ReleaseVersion=${{ needs.version.outputs.release_version }})" |
101 | | - dotnet publish MailAgent/MailAgent.csproj -c Release -r $rid /p:PublishSingleFile=true /p:PublishTrimmed=false /p:SelfContained=true -o $outDir |
| 101 | + $ver='${{ needs.version.outputs.release_version }}' |
| 102 | + $commitShort = git rev-parse --short HEAD |
| 103 | + Write-Host "Publishing for $rid (ReleaseVersion=$ver, Commit=$commitShort)" |
| 104 | + dotnet publish MailAgent/MailAgent.csproj -c Release -r $rid /p:PublishSingleFile=true /p:PublishTrimmed=false /p:SelfContained=true /p:Version=$ver /p:AssemblyVersion=$ver /p:FileVersion=$ver /p:InformationalVersion="$ver+$commitShort" -o $outDir |
102 | 105 | - name: Collect licenses |
103 | 106 | id: collect_licenses |
104 | 107 | uses: ./.github/actions/collect-licenses |
@@ -184,47 +187,24 @@ jobs: |
184 | 187 | uses: actions/download-artifact@v4 |
185 | 188 | with: |
186 | 189 | path: downloaded_artifacts |
187 | | - - name: Generate changelog |
188 | | - id: changelog |
189 | | - shell: bash |
190 | | - run: | |
191 | | - set -euo pipefail |
192 | | - git fetch --tags --quiet |
193 | | - tag="v${{ needs.version.outputs.release_version }}" |
194 | | - currentCommit=$(git rev-parse "$tag" 2>/dev/null || git rev-parse HEAD) |
195 | | - prev=$(git tag --sort=-creatordate | grep -v "^$tag$" | head -n1 || true) |
196 | | - if [[ -z "$prev" ]]; then |
197 | | - notes="First release." |
198 | | - else |
199 | | - log=$(git log "$prev".."$currentCommit" --pretty=format:'* %h %s' | head -n200) |
200 | | - if [[ -z "$log" ]]; then |
201 | | - notes="No commit differences from $prev." |
202 | | - else |
203 | | - notes=$'Changes since '$prev':\n' |
204 | | - notes+="$log" |
205 | | - fi |
206 | | - fi |
207 | | - echo "$notes" | sed ':a;N;$!ba;s/\r//g' > changelog.txt |
208 | | - echo "changelog<<EOF" >> $GITHUB_OUTPUT |
209 | | - cat changelog.txt >> $GITHUB_OUTPUT |
210 | | - echo "EOF" >> $GITHUB_OUTPUT |
211 | | - - name: Create release |
| 190 | + - name: Create release (auto-generated notes) |
212 | 191 | env: |
213 | 192 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
214 | 193 | shell: bash |
215 | 194 | run: | |
216 | 195 | set -euo pipefail |
217 | 196 | ver='${{ needs.version.outputs.release_version }}' |
218 | 197 | tag="v$ver" |
219 | | - body="${{ steps.changelog.outputs.changelog }}" |
220 | 198 | files=( $(find downloaded_artifacts -type f -name '*.zip') ) |
221 | 199 | if [ ${#files[@]} -eq 0 ]; then echo "No ZIP files to upload" >&2; exit 1; fi |
222 | 200 | checksums=$(find downloaded_artifacts -type f -name 'checksums.sha256.txt' -maxdepth 2 || true) |
223 | 201 | echo "Assets: ${#files[@]} ZIP(s)"; [ -n "$checksums" ] && echo "Checksums file: $checksums" |
224 | 202 | if gh release view "$tag" >/dev/null 2>&1; then |
| 203 | + echo 'Release exists: uploading/refreshing assets (notes unchanged)' |
225 | 204 | gh release upload "$tag" "${files[@]}" $checksums --clobber |
226 | 205 | else |
227 | | - gh release create "$tag" "${files[@]}" $checksums --title "mail-agent v$ver" --notes "$body" |
| 206 | + echo 'Creating new release with auto-generated notes' |
| 207 | + gh release create "$tag" "${files[@]}" $checksums --title "mail-agent v$ver" --generate-notes |
228 | 208 | fi |
229 | 209 | - name: Upload final artifacts bundle |
230 | 210 | uses: actions/upload-artifact@v4 |
|
0 commit comments