diff --git a/.auto-changelog.json b/.auto-changelog.json new file mode 100644 index 00000000..b369527c --- /dev/null +++ b/.auto-changelog.json @@ -0,0 +1,5 @@ +{ + "output": "CHANGELOG.md", + "sortCommits": "date-desc", + "commitLint": false +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..b661e2bb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,20 @@ +name: Release Drafter + +on: + push: + branches: + - release + - alpha + - chore/changelog + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into "main" + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + disable-autolabeler: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.prettierignore b/.prettierignore index d155fdbd..b7ce5ef0 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,5 @@ # Add files here to ignore them from prettier formatting /dist /coverage -/.nx/cache \ No newline at end of file +/.nx/cache +auto-changelog-template.hbs \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b35a0fea..e69de29b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +0,0 @@ -# Changelog - -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.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## Unreleased - -- Initial release diff --git a/auto-changelog-template.hbs b/auto-changelog-template.hbs new file mode 100644 index 00000000..e201d9be --- /dev/null +++ b/auto-changelog-template.hbs @@ -0,0 +1,52 @@ +{{#each releases}} + {{#if href}} + ## [{{title}}]({{href}}){{#if tag}} - {{isoDate}}{{/if}} + {{else}} + ## {{title}}{{#if tag}} - {{isoDate}}{{/if}} + {{/if}} + + {{#if merges}} + ### Community Contributions + {{#commit-list merges heading='#### Breaking Changes' message='.*BREAKING.*'}} + - {{message}} [`{{id}}`]({{href}}) + {{/commit-list}} + + {{#commit-list merges heading='#### Bug Fix' message='^fix.*$' exclude='.*BREAKING.*'}} + - {{message}} [`{{id}}`]({{href}}) + {{/commit-list}} + + {{#commit-list merges heading='#### Patches' message='^chore|tests|patch|test.*$' exclude='.*BREAKING.*'}} + - {{message}} [`{{id}}`]({{href}}) + {{/commit-list}} + + {{#commit-list merges heading='#### Documentation' message='^docs|GITBOOK.*$' exclude='.*BREAKING.*'}} + - {{message}} [`{{id}}`]({{href}}) + {{/commit-list}} + + {{#commit-list merges heading='#### Miscellaneous' message='.*' exclude='(^docs|GITBOOK|chore|tests|patch|test|fix.*)|(.*BREAKING.*)'}} + - {{message}} [`{{id}}`]({{href}}) + {{/commit-list}} + {{/if}} + + ### Team Contributions + {{#commit-list commits heading='#### Breaking Changes' message='.*BREAKING.*'}} + - {{message}} [`{{shorthash}}`]({{href}}) + {{/commit-list}} + + {{#commit-list commits heading='#### Bug Fix' message='^fix.*$' exclude='.*BREAKING.*'}} + - {{message}} [`{{shorthash}}`]({{href}}) + {{/commit-list}} + + {{#commit-list commits heading='#### Patches' message='^chore|tests|patch|test.*$' exclude='.*BREAKING.*'}} + - {{message}} [`{{shorthash}}`]({{href}}) + {{/commit-list}} + + {{#commit-list commits heading='#### Documentation' message='^docs|GITBOOK.*$' exclude='.*BREAKING.*'}} + - {{message}} [`{{shorthash}}`]({{href}}) + {{/commit-list}} + + {{#commit-list commits heading='#### Miscellaneous' message='.*' exclude='(^docs|GITBOOK|chore|tests|patch|test|fix.*)|(.*BREAKING.*)'}} + - {{message}} [`{{shorthash}}`]({{href}}) + {{/commit-list}} + +{{/each}} \ No newline at end of file diff --git a/package.json b/package.json index 4231ad94..def37610 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ "db:validate": "nx run api:prisma:validate", "db:format": "nx run api:prisma:format", "db:reset": "nx run api:prisma:reset", - "prepare": "husky install" + "prepare": "husky install", + "generate-changelog": "npx auto-changelog -c .auto-changelog.json --template auto-changelog-template.hbs" }, "private": false, "devDependencies": { @@ -100,6 +101,7 @@ "@nestjs/swagger": "^7.1.17", "@prisma/client": "^5.7.1", "@supabase/supabase-js": "^2.39.2", + "auto-changelog": "^2.4.0", "axios": "^1.6.5", "chalk": "4.1.2", "class-transformer": "^0.5.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2a6c0603..5b3e5587 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,6 +38,9 @@ importers: '@supabase/supabase-js': specifier: ^2.39.2 version: 2.39.2 + auto-changelog: + specifier: ^2.4.0 + version: 2.4.0 axios: specifier: ^1.6.5 version: 1.6.5 @@ -5106,6 +5109,20 @@ packages: /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + /auto-changelog@2.4.0: + resolution: {integrity: sha512-vh17hko1c0ItsEcw6m7qPRf3m45u+XK5QyCrrBFViElZ8jnKrPC1roSznrd1fIB/0vR/zawdECCRJtTuqIXaJw==} + engines: {node: '>=8.3'} + hasBin: true + dependencies: + commander: 7.2.0 + handlebars: 4.7.8 + node-fetch: 2.7.0 + parse-github-url: 1.0.2 + semver: 7.5.4 + transitivePeerDependencies: + - encoding + dev: false + /autoprefixer@10.4.16(postcss@8.4.33): resolution: {integrity: sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==} engines: {node: ^10 || ^12 || >=14} @@ -5438,7 +5455,7 @@ packages: /builtins@5.0.1: resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} dependencies: - semver: 7.5.3 + semver: 7.5.4 dev: true /busboy@1.6.0: @@ -5648,7 +5665,6 @@ packages: /commander@7.2.0: resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} engines: {node: '>= 10'} - dev: true /comment-json@4.2.3: resolution: {integrity: sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==} @@ -7398,6 +7414,19 @@ packages: resolution: {integrity: sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==} dev: true + /handlebars@4.7.8: + resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} + engines: {node: '>=0.4.7'} + hasBin: true + dependencies: + minimist: 1.2.8 + neo-async: 2.6.2 + source-map: 0.6.1 + wordwrap: 1.0.0 + optionalDependencies: + uglify-js: 3.17.4 + dev: false + /harmony-reflect@1.6.2: resolution: {integrity: sha512-HIp/n38R9kQjDEziXyDTuW3vvoxxyxjxFzXLrBr18uB47GnSt+G9D29fqrpM5ZkspMcPICud3XsBJQ4Y2URg8g==} dev: true @@ -9077,7 +9106,6 @@ packages: /neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - dev: true /next@14.0.4(@babel/core@7.23.7)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-qbwypnM7327SadwFtxXnQdGiKpkuhaRLE2uq62/nRul9cj9KhQ5LhHmlziTNqUidZotw/Q1I9OjirBROdUJNgA==} @@ -9605,6 +9633,12 @@ packages: callsites: 3.1.0 dev: true + /parse-github-url@1.0.2: + resolution: {integrity: sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==} + engines: {node: '>=0.10.0'} + hasBin: true + dev: false + /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -11538,6 +11572,14 @@ packages: engines: {node: '>=14.17'} hasBin: true + /uglify-js@3.17.4: + resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} + engines: {node: '>=0.8.0'} + hasBin: true + requiresBuild: true + dev: false + optional: true + /uid@2.0.2: resolution: {integrity: sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==} engines: {node: '>=8'} @@ -11968,6 +12010,10 @@ packages: resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} dev: true + /wordwrap@1.0.0: + resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + dev: false + /wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'}