Skip to content

Commit 90f0ba8

Browse files
authored
chore(actions): 增加 auto release (#194)
1 parent bf123d7 commit 90f0ba8

File tree

13 files changed

+127
-26
lines changed

13 files changed

+127
-26
lines changed

.github/workflows/auto-release.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: 🚀 Auto Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
release:
9+
runs-on: macos-latest
10+
if: startsWith(github.event.head_commit.message , 'chore(release):')
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Use Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
20+
# 发布开始通知
21+
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
22+
- name: Release start notify
23+
uses: zcong1993/actions-ding@master
24+
with:
25+
dingToken: ${{ secrets.DING_TALK_ACCESS_TOKEN }}
26+
ignoreError: true
27+
body: |
28+
{
29+
"msgtype": "link",
30+
"link": {
31+
"title": "🚀 FEngine 开始发布",
32+
"text": "🔗 查看详情",
33+
"messageUrl": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
34+
"picUrl": "https://gw.alipayobjects.com/zos/finxbff/compress-tinypng/ea88c724-38fb-42aa-8055-0e08155368b9.png"
35+
}
36+
}
37+
38+
- name: Install dependencies
39+
run: yarn
40+
41+
- name: lint
42+
run: |
43+
npm run lint
44+
45+
- name: build
46+
run: |
47+
npm run build
48+
env:
49+
CI: false
50+
51+
- name: test
52+
run: |
53+
npm run test
54+
55+
- name: Prepare
56+
# https://github.com/lerna/lerna/issues/2404
57+
# https://github.com/lerna/lerna/issues/2788
58+
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
59+
env:
60+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
61+
62+
- name: Release
63+
env:
64+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
66+
run: npm run release
67+
68+
# 发布失败通知内部开发群
69+
- name: Release failed notify
70+
if: ${{ failure() }}
71+
uses: zcong1993/actions-ding@master
72+
with:
73+
dingToken: ${{ secrets.DING_TALK_ACCESS_TOKEN }}
74+
ignoreError: true
75+
body: |
76+
{
77+
"msgtype": "link",
78+
"link": {
79+
"title": "😳😳😳 FEngine 发布失败",
80+
"text": "🔗 请点击链接查看具体原因, 及时修复, 尝试点击右上角 [Re-run all jobs] 重试, 或手动发布",
81+
"messageUrl": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
82+
"picUrl": "https://gw.alipayobjects.com/zos/finxbff/compress-tinypng/ea88c724-38fb-42aa-8055-0e08155368b9.png"
83+
}
84+
}
85+
86+
- name: Release success notify
87+
if: ${{ success() }}
88+
uses: visiky/dingtalk-release-notify@main
89+
with:
90+
DING_TALK_TOKEN: ${{ secrets.DING_TALK_ACCESS_TOKEN }}
91+
notify_title: '🎉 FEngine 新版本发布啦 🎉'
92+
notify_body: '## { title } <hr /> ![preview](https://gw.alipayobjects.com/zos/finxbff/compress-tinypng/c833f8c9-c629-4943-a09b-ce1bf17ca937.png) <hr /> { body } <hr />'
93+
notify_footer: '> 前往 [**AntV/FEngine Releases**]({ release_url })查看完整更新日志.'
94+
at_all: false
95+
enable_prerelease: false

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ es/
7676
demos/index.html
7777
demos/assets/screenshots
7878
demos/debug.html
79+
.npmrc
7980

8081
*.sw*
8182
*.un~

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,4 @@ gatsby-browser.js
8181
gatsby-config.js
8282
.cache
8383
public
84+
.npmrc

lerna.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"npmClientArgs": ["--no-package-lock"]
99
},
1010
"publish": {
11-
"commitHooks": false
11+
"commitHooks": false,
12+
"conventionalCommits": true,
13+
"createRelease": "github",
14+
"message": "🤖 publish"
1215
}
1316
}
1417
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"jest": "^26.6.3",
2828
"jest-electron": "^0.1.12",
2929
"jest-image-snapshot": "^6.1.0",
30-
"lerna": "^3.22.1",
30+
"lerna": "^6.6.2",
3131
"pre-commit": "^1.2.2",
3232
"ts-jest": "^26.4.4",
3333
"typescript": "^4.1.3"
@@ -48,6 +48,7 @@
4848
"lint": "eslint ./",
4949
"lint-fix": "eslint --fix ./",
5050
"publish": "npm run build && npm run test && lerna publish",
51+
"release": "lerna publish --yes --summary-file",
5152
"ci": "npm run lint && npm run build && npm run test",
5253
"refresh": "lerna clean && yarn && lerna bootstrap",
5354
"prettier": "prettier --write './packages/**/*.{ts,tsx}'"

packages/f-engine/.fatherrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default process.env.CI
1+
export default process.env.CI && process.env.CI === 'true'
22
? {}
33
: {
44
umd: {

packages/f-engine/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
22
"name": "@antv/f-engine",
3-
"version": "0.0.46",
3+
"version": "1.0.0",
44
"main": "lib/index.js",
55
"module": "es/index.js",
66
"types": "es/index.d.ts",
77
"miniprogram": "dist",
88
"sideEffects": false,
99
"dependencies": {
10-
"@antv/g-gesture": "~0.0.40",
11-
"@antv/g-lite": "~1.0.6",
12-
"@antv/g-mobile-canvas": "~0.8.14",
13-
"@antv/g-mobile-canvas-element": "~0.6.17",
14-
"@antv/g-mobile-svg": "~0.8.14",
15-
"@antv/g-mobile-webgl": "~0.7.20",
16-
"@antv/g-web-animations-api": "~1.0.6",
10+
"@antv/g-gesture": "~2.2.0",
11+
"@antv/g-lite": "~1.2.0",
12+
"@antv/g-mobile-canvas": "~0.10.0",
13+
"@antv/g-mobile-canvas-element": "~0.8.0",
14+
"@antv/g-mobile-svg": "~0.10.0",
15+
"@antv/g-mobile-webgl": "~0.9.0",
16+
"@antv/g-web-animations-api": "~1.2.0",
1717
"@antv/util": "^3.0.6",
1818
"@babel/runtime": "^7.12.5",
1919
"eventemitter3": "^4.0.0",
2020
"tslib": "^2.3.1"
2121
},
2222
"devDependencies": {
23-
"@antv/f-test-utils": "^0.0.3"
23+
"@antv/f-test-utils": "~1.0.0"
2424
},
2525
"homepage": "https://github.com/antvis/FEngine",
2626
"author": "https://github.com/orgs/antvis/people",

packages/f-lottie/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/f-lottie",
3-
"version": "0.0.45",
3+
"version": "1.0.0",
44
"description": "FEngine for Lottie",
55
"main": "lib/index.js",
66
"module": "es/index.js",
@@ -15,13 +15,13 @@
1515
"lottie"
1616
],
1717
"dependencies": {
18-
"@antv/f-engine": "^0.0.46",
19-
"@antv/g-lottie-player": "~0.0.11",
18+
"@antv/f-engine": "~1.0.0",
19+
"@antv/g-lottie-player": "~0.2.0",
2020
"@babel/runtime": "^7.12.5",
2121
"tslib": "^2.3.1"
2222
},
2323
"devDependencies": {
24-
"@antv/f-test-utils": "^0.0.3"
24+
"@antv/f-test-utils": "~1.0.0"
2525
},
2626
"homepage": "https://f2.antv.vision",
2727
"author": "https://github.com/orgs/antvis/people",

packages/f-my/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/f-my",
3-
"version": "0.0.46",
3+
"version": "1.0.0",
44
"description": "FEngine for alipay mini-program",
55
"main": "lib/index.js",
66
"module": "es/index.js",
@@ -17,8 +17,8 @@
1717
"alipay"
1818
],
1919
"dependencies": {
20-
"@antv/f-engine": "^0.0.46",
21-
"@antv/f2-context": "^0.0.1",
20+
"@antv/f-engine": "~1.0.0",
21+
"@antv/f2-context": "~0.0.1",
2222
"@babel/runtime": "^7.12.5",
2323
"tslib": "^2.3.1"
2424
},

packages/f-react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/f-react",
3-
"version": "0.0.46",
3+
"version": "1.0.0",
44
"description": "FEngine for React",
55
"main": "lib/index.js",
66
"module": "es/index.js",
@@ -16,7 +16,7 @@
1616
"react"
1717
],
1818
"dependencies": {
19-
"@antv/f-engine": "^0.0.46",
19+
"@antv/f-engine": "~1.0.0",
2020
"@babel/runtime": "^7.12.5",
2121
"tslib": "^2.3.1"
2222
},

0 commit comments

Comments
 (0)