Skip to content

Commit

Permalink
chore: add release config
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxingkang committed Jun 17, 2024
1 parent 807b66e commit 216b851
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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

27 changes: 27 additions & 0 deletions release.config.mjs
Original file line number Diff line number Diff line change
@@ -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}',
},
],
],
}

0 comments on commit 216b851

Please sign in to comment.