diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml deleted file mode 100644 index d8def2e..0000000 --- a/.github/workflows/changelog.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Generate CHANGELOG.md - -on: - workflow_run: # only runs on default branch - workflows: [CI] - types: [completed] - branches: [main] - workflow_dispatch: - schedule: - - cron: 0 12 * * 5 - -concurrency: - group: generate-changelog - cancel-in-progress: true - -jobs: - changelog: - runs-on: ubuntu-latest - if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} - permissions: - contents: write - timeout-minutes: 3 - - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - uses: orhun/git-cliff-action@v4 - with: - config: cliff.toml - args: v1.0.0..HEAD - env: - OUTPUT: CHANGELOG.md - GITHUB_REPO: ${{ github.repository }} - - - uses: ryancyq/github-signed-commit@v1 - env: - GH_TOKEN: ${{ github.token }} - with: - files: | - CHANGELOG.md - commit-message: "ci: update CHANGELOG.md" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e7f5d24..eb09fa9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,8 @@ jobs: contents: write steps: - uses: actions/checkout@v6 + with: + fetch-depth: 0 - uses: actions/setup-node@v6 with: @@ -29,11 +31,22 @@ jobs: - run: npm version --no-git-tag-version ${{ env.NPM_VERSION }} - - name: Commit package.json + - uses: orhun/git-cliff-action@v4 + with: + config: cliff.toml + args: --tag v${{ env.NPM_VERSION }} + env: + OUTPUT: CHANGELOG.md + GITHUB_REPO: ${{ github.repository }} + + - name: Commit package.json and CHANGELOG.md uses: ryancyq/github-signed-commit@v1 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - files: package*.json + files: | + package.json + package-lock.json + CHANGELOG.md commit-message: "release: Bump version for ${{ env.NPM_VERSION }}" - tag: v${{ env.NPM_VERSION }} \ No newline at end of file + tag: v${{ env.NPM_VERSION }} diff --git a/cliff.toml b/cliff.toml index a36f1d7..926c5e7 100644 --- a/cliff.toml +++ b/cliff.toml @@ -62,22 +62,25 @@ commit_preprocessors = [ ] # regex for parsing and grouping commits commit_parsers = [ - { message = "^feat", group = "Features" }, - { message = "^fix", group = "Bug Fixes" }, - { message = "^doc", group = "Documentation" }, - { message = "^perf", group = "Performance" }, - { message = "^refactor", group = "Refactoring" }, - { message = "^style", group = "Style" }, - { message = "^revert", group = "Revert" }, - { message = "^test", group = "Tests" }, - { message = "^chore\\(version\\):", skip = true }, - { message = "^chore", group = "Miscellaneous Chores", skip = true }, - { message = "^ci", skip = true }, - { message = "^release", skip = true }, + { message = "^feat[\\(:]", group = "Features" }, + { message = "^fix[\\(:]", group = "Bug Fixes" }, + { message = "^doc[\\(:]", group = "Documentation" }, + { message = "^perf[\\(:]", group = "Performance" }, + { message = "^refactor[\\(:]", group = "Refactoring" }, + { message = "^style[\\(:]", group = "Style" }, + { message = "^revert[\\(:]", group = "Revert" }, + { message = "^test[\\(:]", group = "Tests" }, + { message = "^lib[\\(:]", group = "Dependencies" }, + { message = "^build[\\(:]", group = "Dependencies" }, + { message = "^Bump .+ from .+ to .+", group = "Dependencies" }, + { message = "^Update .+ requirement from .+ to .+", group = "Dependencies" }, + { message = "^chore[\\(:]", skip = true }, + { message = "^ci[\\(:]", skip = true }, + { message = "^release[\\(:]", skip = true }, { body = ".*security", group = "Security" }, ] # filter out the commits that are not matched by commit parsers -filter_commits = false +filter_commits = true # sort the tags topologically topo_order = false # sort the commits inside sections by oldest/newest order