diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e6c6641 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +name: 🎉 Release + +env: + NODE_OPTIONS: --max-old-space-size=6144 + +on: + workflow_dispatch: + +jobs: + build-and-release: + name: 🔨 Build + 🚀 Release + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: latest + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + + - name: Cache pnpm modules + id: cache-node-modules + uses: actions/cache@v3 + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + shell: bash + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + run: npx semantic-release + diff --git a/release.config.mjs b/release.config.mjs new file mode 100644 index 0000000..6870133 --- /dev/null +++ b/release.config.mjs @@ -0,0 +1,27 @@ +/** + * @type {import('semantic-release').GlobalConfig} + */ +export default { + branches: ['main', 'next'], + plugins: [ + '@semantic-release/commit-analyzer', + '@semantic-release/release-notes-generator', + [ + '@semantic-release/changelog', + { + changelogFile: 'CHANGELOG.md', + }, + ], + '@semantic-release/npm', + '@semantic-release/github', + [ + '@semantic-release/git', + { + assets: ['CHANGELOG.md', 'package.json'], + message: + // eslint-disable-next-line no-template-curly-in-string + 'chore(release): ${nextRelease.gitTag} [skip ci] \n\n${nextRelease.notes}', + }, + ], + ], +}