Skip to content

Commit

Permalink
Merge pull request #9 from anyone-yuren/deploy-gbeata
Browse files Browse the repository at this point in the history
Deploy gbeata
  • Loading branch information
anyone-yuren authored Dec 15, 2023
2 parents e7e3958 + 295bd5e commit 2c172db
Show file tree
Hide file tree
Showing 8 changed files with 1,443 additions and 6 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 工作流名称
name: Build and Deploy

on:
# 指明要运行的分支,跟上面配置保持一致
push:
branches: [main]

jobs:
publish:
name: 发布 ui 工作流
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
# 执行步骤
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8

- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
cache: "pnpm"

- name: Install dependencies
run: |
cd ./packages/gbeata
pnpm install --frozen-lockfile
- name: Build
run: |
echo ${{ github.workspace }}
cd ./packages/gbeata
pnpm build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PACKAGE }}
run: npx semantic-release
10 changes: 10 additions & 0 deletions .github/workflows/deploy-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ jobs:
cd ./packages/gbeata
pnpm build
- name: Create Release Pull Request and Publish
uses: changesets/action@v1
with:
version: pnpm change:ver
publish: pnpm change:pub
commit: "ci: release"
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PACKAGE }}

- name: publish
run: |
cd ./packages/gbeata
Expand Down
21 changes: 21 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
branches: ["main"], // 指定在哪个分支下要执行发布操作
plugins: [
"@semantic-release/commit-analyzer", // 解析 commit 信息,默认就是 Angular 规范
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
changelogFile: "CHANGELOG.md", // 把发布日志写入该文件
},
],
"@semantic-release/npm", // 发布到NPM
"@semantic-release/github",
[
"@semantic-release/git",
{
assets: ["CHANGELOG.md", "package.json"], // 前面说到日志记录和版本好是新增修改的,需要 push 回 Git
},
],
],
};
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"commit": "git add -A && git cz",
"release": "turbo release",
"init-changeset": "changeset init",
"change:ver": "changeset version",
"change:pub": "changeset publish",
"clean": "pnpm clean:node-modules & pnpm clean:turbo-cache",
"clean:node-modules": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +",
"clean:turbo-cache": "rm -rf ./node_modules/.cache",
Expand All @@ -32,12 +34,18 @@
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@gbeata/config-eslint": "workspace:^",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.2.5",
"@semantic-release/npm": "^11.0.2",
"@semantic-release/release-notes-generator": "^12.1.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"cz-git": "^1.8.0",
"eslint": "^8.55.0",
"husky": "^8.0.3",
"prettier": "^3.1.0",
"semantic-release": "^22.0.12",
"turbo": "^1.11.0"
},
"dependencies": {
Expand Down
2 changes: 0 additions & 2 deletions packages/gbeata/.npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@

registry=https://registry.npmjs.org/
registry.npmjs.org/:always-auth=true
registry.npmjs.org/:_authToken=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
7 changes: 7 additions & 0 deletions packages/gbeata/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# gbeata

## 0.0.3

### Patch Changes

- test
4 changes: 2 additions & 2 deletions packages/gbeata/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gbeata",
"version": "0.0.2",
"version": "0.0.3",
"description": "基于最新antd5二次封装的组件库",
"keywords": [
"ant",
Expand Down Expand Up @@ -32,7 +32,7 @@
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
"prepublishOnly": "father doctor && npm run build",
"release": "npm run build && npm publish --access public",
"release": "npm run build && npm publish --access public --force",
"start": "npm run dev"
},
"commitlint": {
Expand Down
Loading

0 comments on commit 2c172db

Please sign in to comment.