Skip to content

Commit

Permalink
chore(actions): 增加 auto release (#1803)
Browse files Browse the repository at this point in the history
  • Loading branch information
zengyue authored Jun 27, 2023
1 parent 77a5781 commit 93e1307
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 10 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: 🚀 Auto Release
on:
push:
branches:
- v5.0.x

jobs:
release:
runs-on: macos-latest
if: startsWith(github.event.head_commit.message , 'chore(release):')

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18

# 发布开始通知
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
- name: Release start notify
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ secrets.DING_TALK_ACCESS_TOKEN }}
ignoreError: true
body: |
{
"msgtype": "link",
"link": {
"title": "🚀 F2 开始发布",
"text": "🔗 查看详情",
"messageUrl": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"picUrl": "https://gw.alipayobjects.com/zos/finxbff/compress-tinypng/ea88c724-38fb-42aa-8055-0e08155368b9.png"
}
}
- name: Install dependencies
run: yarn

- name: lint
run: |
npm run lint
- name: build
run: |
npm run build
env:
CI: false

- name: test
run: |
npm run test
- name: Prepare
# https://github.com/lerna/lerna/issues/2404
# https://github.com/lerna/lerna/issues/2788
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Release
env:
GH_TOKEN: ${{ secrets.SUOQIU_GITHUB_TOKEN }}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
run: npm run release

# 发布失败通知内部开发群
- name: Release failed notify
if: ${{ failure() }}
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ secrets.DING_TALK_ACCESS_TOKEN }}
ignoreError: true
body: |
{
"msgtype": "link",
"link": {
"title": "😳😳😳 F2 发布失败",
"text": "🔗 请点击链接查看具体原因, 及时修复, 尝试点击右上角 [Re-run all jobs] 重试, 或手动发布",
"messageUrl": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"picUrl": "https://gw.alipayobjects.com/zos/finxbff/compress-tinypng/ea88c724-38fb-42aa-8055-0e08155368b9.png"
}
}
- name: Release success notify
if: ${{ success() }}
uses: visiky/dingtalk-release-notify@main
with:
DING_TALK_TOKEN: ${{ secrets.DING_TALK_ACCESS_TOKEN }}
notify_title: '🎉 F2 新版本发布啦 🎉'
notify_body: '## { title } <hr /> ![preview](https://gw.alipayobjects.com/zos/finxbff/compress-tinypng/c833f8c9-c629-4943-a09b-ce1bf17ca937.png) <hr /> { body } <hr />'
notify_footer: '> 前往 [**AntV/F2 Releases**]({ release_url })查看完整更新日志.'
at_all: false
enable_prerelease: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ es/
demos/index.html
demos/assets/screenshots
demos/debug.html
.npmrc

*.sw*
*.un~
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ gatsby-browser.js
gatsby-config.js
.cache
public
.npmrc
5 changes: 4 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"npmClientArgs": ["--no-package-lock"]
},
"publish": {
"commitHooks": false
"commitHooks": false,
"conventionalCommits": true,
"createRelease": "github",
"message": "🤖 publish"
}
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"prettier": "prettier --write './packages/**/*.{ts,tsx}'",
"canary": "npm run build && npm run test && lerna publish --canary --dist-tag next",
"publish": "npm run build && npm run test && lerna publish --dist-tag next",
"release": "lerna publish --yes --summary-file --dist-tag next",
"refresh": "lerna clean && yarn && lerna bootstrap",
"site:build": "cd ./site && npm run site:build",
"site:clean": "cd ./site && npm run site:clean",
Expand Down Expand Up @@ -82,7 +83,7 @@
"jest": "^26.6.3",
"jest-electron": "^0.1.12",
"jest-image-snapshot": "^6.1.0",
"lerna": "^3.22.1",
"lerna": "^6.6.2",
"limit-size": "^0.1.4",
"pre-commit": "^1.2.2",
"rollup-plugin-visualizer": "^5.6.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/f2-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"react"
],
"dependencies": {
"@antv/f-react": "~0.0.17",
"@antv/f2": "^5.0.26",
"@antv/f-react": "^1.0.1",
"@antv/f2": "~5.0.26",
"@babel/runtime": "^7.12.5",
"tslib": "^2.3.1"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/f2-wordcloud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"wordcloud"
],
"dependencies": {
"@antv/f2": "^5.0.26",
"@antv/f2": "~5.0.26",
"@antv/util": "~3.3.0",
"@babel/runtime": "^7.12.5",
"tslib": "^2.3.1"
},
"devDependencies": {
"@antv/f-test-utils": "~0.0.1",
"@antv/f-test-utils": "^1.0.1",
"jest-mock-random": "~1.1.1"
},
"homepage": "https://f2.antv.vision/zh/",
Expand Down
2 changes: 1 addition & 1 deletion packages/f2/.fatherrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { visualizer } from 'rollup-plugin-visualizer';
const isBundleVis = !!process.env.BUNDLE_VIS;

export default process.env.CI && process.env.CI !== 'false'
export default process.env.CI && process.env.CI === 'true'
? {}
: {
umd: {
Expand Down
6 changes: 3 additions & 3 deletions packages/f2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"types": "es/index.d.ts",
"dependencies": {
"@antv/event-emitter": "^0.1.2",
"@antv/f-engine": "~0.0.3",
"@antv/f-lottie": "~0.0.2",
"@antv/util": "~3.3.0",
"@antv/f-engine": "^1.0.1",
"@antv/f-lottie": "^1.0.1",
"@antv/util": "^3.0.6",
"@babel/runtime": "^7.12.5",
"d3-cloud": "~1.2.5",
"fecha": "~4.2.0",
Expand Down

0 comments on commit 93e1307

Please sign in to comment.