Skip to content

Commit

Permalink
feat: semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur-er committed Dec 28, 2023
1 parent e94124f commit 79d9e4a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 23 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,39 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node.js
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: 20

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
with:
extra_plugins: |
@semantic-release/git
run: pnpm semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26 changes: 21 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,26 @@
"eslint --fix"
]
},
"np": {
"message": "chore(release): %s",
"tag": "latest",
"branch": "main",
"anyBranch": false
"release": {
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"package-lock.json",
"CHANGELOG.md",
"build"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/npm",
"@semantic-release/github"
]
}

}
10 changes: 0 additions & 10 deletions release.config.js

This file was deleted.

0 comments on commit 79d9e4a

Please sign in to comment.