diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000..289efd2 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,41 @@ +name: Generate Changelog + +on: + push: + branches: + - V1.0.0 + - Beta + - backup-branch + pull_request: + branches: + - V1.0.0 + - Beta + - backup-branch + release: + types: [published] + +jobs: + changelog: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '22' + + - name: Install dependencies + run: npm install + + - name: Generate Changelog + run: npm run release + + - name: Commit changelog + run: | + git config --local user.name "GitHub Actions" + git config --local user.email "actions@github.com" + git add CHANGELOG.md + git commit -m "chore: update changelog" + git push diff --git a/package.json b/package.json index f214fe6..9aadb04 100755 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "Akira's Test Bot", "main": "index.js", "scripts": { + "release": "standard-version", "build": "tsc", "start": "NODE_ENV=production npm run build && node -r tsconfig-paths/register dist/index.js", "dev": "NODE_ENV=development ts-node -r tsconfig-paths/register src/index.ts" @@ -32,6 +33,7 @@ "typescript": "^5.5.4" }, "devDependencies": { - "@types/uuid": "^10.0.0" + "@types/uuid": "^10.0.0", + "standard-version": "^9.5.0" } }