diff --git a/.github/workflows/generate-release-notes.yaml b/.github/workflows/generate-release-notes.yaml deleted file mode 100644 index 7352c5cb..00000000 --- a/.github/workflows/generate-release-notes.yaml +++ /dev/null @@ -1,96 +0,0 @@ -name: Generate Release Notes - -on: - release: - types: [published] - -jobs: - generate-release-notes: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: read - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' - - - name: Install GREN - run: npm install -g github-release-notes - - - name: Generate release notes - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gren release --token=$GITHUB_TOKEN \ - --data-source=prs \ - --prefix=v \ - --tags=${{ github.event.release.tag_name }} \ - --changelog=true \ - --updateChangelog=true - - - name: Commit CHANGELOG.md - continue-on-error: true - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - if git diff --quiet CHANGELOG.md; then - echo "No changes to CHANGELOG.md" - else - git add CHANGELOG.md - git commit -m "docs: update CHANGELOG for ${{ github.event.release.tag_name }}" - git push - fi - - - name: Update release notes on GitHub - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Extract release notes from generated file - RELEASE_ID=${{ github.event.release.id }} - TAG=${{ github.event.release.tag_name }} - - # Get the generated notes (GREN creates them in release description) - echo "Release notes generation complete for $TAG" - echo "See CHANGELOG.md for the full changelog" - - update-changelog: - runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'published' - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install GREN - run: npm install -g github-release-notes - - - name: Update changelog only - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gren changelog --update --token=$GITHUB_TOKEN --data-source=prs || true - - - name: Commit updated changelog - continue-on-error: true - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - git add CHANGELOG.md || true - git commit -m "docs: update CHANGELOG for release ${{ github.event.release.tag_name }}" || true - git push || true diff --git a/.github/workflows/publish-to-nuget.yaml b/.github/workflows/publish-to-nuget.yaml index d69b7b56..7e8b8dd5 100644 --- a/.github/workflows/publish-to-nuget.yaml +++ b/.github/workflows/publish-to-nuget.yaml @@ -9,18 +9,16 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - strategy: - matrix: - dotnet-version: ['8.0', '9.0', '10.0'] + steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - name: Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: - dotnet-version: ${{ matrix.dotnet-version }} + dotnet-version: 10.0.x - name: Restore dependencies run: dotnet restore diff --git a/.github/workflows/update-changelog.yaml b/.github/workflows/update-changelog.yaml new file mode 100644 index 00000000..62c55419 --- /dev/null +++ b/.github/workflows/update-changelog.yaml @@ -0,0 +1,34 @@ +name: "Update Changelog" + +on: + release: + types: [released] + +jobs: + update: + runs-on: ubuntu-latest + + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # updated CHANGELOG back to the repository. + # https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/ + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.target_commitish }} + + - name: Update Changelog + uses: stefanzweifel/changelog-updater-action@v1 + with: + latest-version: ${{ github.event.release.tag_name }} + release-notes: ${{ github.event.release.body }} + + - name: Commit updated CHANGELOG + uses: stefanzweifel/git-auto-commit-action@v5 + with: + branch: ${{ github.event.release.target_commitish }} + commit_message: Update CHANGELOG + file_pattern: CHANGELOG.md \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..825c32f0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog