Skip to content

Commit

Permalink
ci: add semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
wood3n committed Mar 13, 2024
1 parent fb1881b commit ce1531e
Show file tree
Hide file tree
Showing 11 changed files with 1,418 additions and 525 deletions.
8 changes: 0 additions & 8 deletions .changeset/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/config.json

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/mighty-cheetahs-boil.md

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Deploy Rspress site to Pages
on:
push:
branches: [master]
paths:
- 'website/**'

workflow_dispatch:

Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release
on:
push:
branches:
- master

permissions:
contents: read # for checkout

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm clean-install
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

exec < /dev/tty && npx cz --hook || true
6 changes: 6 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"branches": [
"master",
"next"
]
}
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"editor.formatOnPaste": true
},
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"yaml.schemas": {
"https://json.schemastore.org/github-workflow": "/.github/workflows/**/*.yml"
}
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<img width="200px" height="200px" src="./website/docs//public/react-filter.png">
</p>

[![npm version](https://badge.fury.io/js/@react-filter%2Fantd.svg)](https://badge.fury.io/js/@react-filter%2Fantd)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

## 安装

```shell
Expand Down
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@
"dev:website": "pnpm --filter website run dev",
"build:antd": "pnpm --filter @react-filter/antd run build",
"build:website": "pnpm --filter website run build",
"publish": "pnpm publish --filter @react-filter/antd --access=public",
"ci:publish": "pnpm publish -r",
"lint-fix": "eslint --fix --ext .js,.jsx,.ts,.tsx . && stylelint \"**/*.{css,less}\" --fix",
"prettier": "prettier . --write",
"cm": "cz",
"test": "jest"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^18.2.0",
"@commitlint/config-conventional": "^18.1.0",
"@types/node": "^20.10.4",
"@types/react": "^17.0.69",
"@types/react-dom": "^17.0.22",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.52.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.0.0",
Expand All @@ -53,9 +55,8 @@
"husky": "^8.0.3",
"is-ci": "^3.0.1",
"lint-staged": "^15.0.2",
"postcss": "^8.4.31",
"postcss-less": "^6.0.0",
"prettier": "^3.0.3",
"semantic-release": "^23.0.2",
"stylelint": "^15.11.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-prettier": "^4.0.2",
Expand All @@ -68,6 +69,11 @@
"prettier --write"
],
"*.{json,md}": "prettier --write",
"*.{css,less}": "stylelint --fix"
"*.css": "stylelint --fix"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
Loading

0 comments on commit ce1531e

Please sign in to comment.