Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
- [ ] XML doc comments updated for all public API changes
- [ ] `dotnet format` run with no issues
- [ ] README and `/samples` updated — if public API changed
- [ ] PR label added (`breaking` / `feat` / `fix` / `docs`) — for changelog categorization
23 changes: 23 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: Breaking Changes
labels:
- breaking
- title: New Features
labels:
- feat
- enhancement
- title: Bug Fixes
labels:
- fix
- bug
- title: Documentation
labels:
- docs
- documentation
- title: Other Changes
labels:
- '*'
61 changes: 60 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,68 @@ jobs:
is-preview: ${{ env.is-preview }}
notes-start-tag: ${{ steps.determine-notes-start-tag.outputs.notes-start-tag }}

update-changelog:
name: 'Update CHANGELOG.md'
needs: [workflow-variables, release, versioning]
if: ${{ needs.workflow-variables.outputs.is-release == 'true' }}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
release-version: ${{ needs.versioning.outputs.release-version }}
steps:
- name: 'Checkout ${{ github.ref }}'
uses: actions/checkout@v6
with:
ref: ${{ github.ref }}

- name: 'Fetch release notes'
shell: bash
run: |
gh release view ${{ env.release-version }} --json body --jq '.body' > /tmp/release-notes.txt

- name: 'Prepend entry to CHANGELOG.md'
shell: bash
run: |
release_date=$(date -u +%Y-%m-%d)
{
echo "## ${{ env.release-version }} — ${release_date}"
echo ""
cat /tmp/release-notes.txt
echo ""
} > /tmp/new-entry.txt
awk '
/<!-- New entries are prepended automatically by the release workflow. -->/ {
print
print ""
while ((getline line < "/tmp/new-entry.txt") > 0) print line
close("/tmp/new-entry.txt")
next
}
{ print }
' CHANGELOG.md > /tmp/changelog-new.md
mv /tmp/changelog-new.md CHANGELOG.md

- name: 'Configure git identity'
uses: './.github/actions/git/configure-identity'

- name: 'Commit and push CHANGELOG.md'
shell: bash
run: |
git add CHANGELOG.md
git diff --staged --quiet || (
git commit -m "Update CHANGELOG.md for ${{ env.release-version }}" &&
git pull --rebase origin ${{ github.ref_name }} &&
git push
)

- name: 'Write changelog summary'
shell: bash
run: |
echo "✅ CHANGELOG.md updated for **${{ env.release-version }}**." >> $GITHUB_STEP_SUMMARY

merge-to-main:
name: 'Merge ${{ github.ref_name }} into main'
needs: [workflow-variables, release, versioning]
needs: [workflow-variables, release, versioning, update-changelog]
if: ${{ needs.workflow-variables.outputs.is-release == 'true' }}
runs-on: ubuntu-latest
permissions:
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

Release history is tracked via GitHub Releases.
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and release notes are generated automatically from merged pull requests.

See all releases at: <https://github.com/petesramek/polyline-algorithm-csharp/releases>

<!-- New entries are prepended automatically by the release workflow. -->
1 change: 1 addition & 0 deletions docs/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Version bumping runs independently via `bump-version.yml` (manual trigger).
| `pack` | `versioning`, `build` | Packages binaries |
| `publish-package` | `pack` | Publishes to NuGet.org (Production environment) |
| `create-release` | `versioning`, `publish-package` | Creates a git tag + GitHub release with auto-generated notes |
| `update-changelog` | `release` | Fetches release notes and prepends a new entry to `CHANGELOG.md` — stable releases only |
| `generate-docs` | `versioning` | Builds DocFX site |
| `publish-docs` | `generate-docs` | Deploys to GitHub Pages |

Expand Down
Loading