From 45a44ec780020496005040e2a316cb3b5060aed0 Mon Sep 17 00:00:00 2001 From: Seungwoo321 Date: Fri, 9 May 2025 14:18:14 +0900 Subject: [PATCH] ci: add workflows --- .github/workflows/release-vue-pivottable.yml | 45 ++++++++++ .releaserc.json | 91 ++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 .github/workflows/release-vue-pivottable.yml create mode 100644 .releaserc.json diff --git a/.github/workflows/release-vue-pivottable.yml b/.github/workflows/release-vue-pivottable.yml new file mode 100644 index 0000000..6fe3366 --- /dev/null +++ b/.github/workflows/release-vue-pivottable.yml @@ -0,0 +1,45 @@ +name: Release vue-pivottable + +on: + push: + branches: + - main +jobs: + release: + name: Release + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + pull-requests: write + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '22.10.0' + registry-url: 'https://registry.npmjs.org/' + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: latest + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm build + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + pnpm dlx semantic-release diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..6956a3e --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,91 @@ +{ + "branches": ["main"], + "tagFormat": "vue-pivottable@${version}", + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "angular", + "parserOpts": { + "headerPattern": "^(\\w*)\\(([\\w\\-]+)\\):\\s(.*)$", + "headerCorrespondence": ["type", "scope", "subject"] + }, + "releaseRules": [ + { + "type": "feat", + "release": "minor" + }, + { "type": "fix", "release": "patch" }, + { + "type": "docs", + "release": "patch" + }, + { + "type": "style", + "release": "patch" + }, + { + "type": "refactor", + "release": "patch" + }, + { + "type": "perf", + "release": "patch" + }, + { + "type": "test", + "release": "patch" + }, + { + "type": "build", + "release": "patch" + }, + { "type": "ci", "release": "patch" }, + { + "type": "chore", + "release": "patch" + } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "angular", + "parserOpts": { + "headerPattern": "^(\\w*)\\(([\\w\\-]+)\\):\\s(.*)$", + "headerCorrespondence": ["type", "scope", "subject"] + }, + "writerOpts": { + "commitsSort": ["scope", "subject"] + } + } + ], + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md" + } + ], + [ + "@semantic-release/npm", + { + "pkgRoot": "." + } + ], + [ + "@semantic-release/git", + { + "assets": ["package.json", "CHANGELOG.md"], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ], + [ + "@semantic-release/github", + { + "successComment": "🎉 이 PR은 [${nextRelease.version}](https://github.com/vue-pivottable/vue3-pivottable/releases/tag/@vue-pivottable/lazy-table-renderer@${nextRelease.version})에 포함되었습니다.", + "failTitle": "semantic-release 실패" + } + ] + ] +}