chore: fix 4.x-stable publish script (#44665)

* chore: fix 4.x-stable publish script

* chore: add notice before publish to npm (#41613)

* chore: add notice before publish to npm

* chore: add notice before publish to npm

* chore: ignore locale folder for eslint check

* chore: ignore locale folder for eslint check

* chore: change notification sound

* chore: migrate to actions/checkout@v4
This commit is contained in:
afc163 2023-09-07 09:29:34 +08:00 committed by GitHub
parent bc46d4bec0
commit a014f7cde2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 34 additions and 23 deletions

View File

@ -29,3 +29,6 @@ coverage
# Scripts
scripts/previewEditor/**/*
jest-stare
locale
.dumi
report.html

View File

@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: cache package-lock.json
uses: actions/cache@v3
@ -55,7 +55,7 @@ jobs:
needs: setup
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:

View File

@ -16,7 +16,7 @@ jobs:
if: github.event.issue.pull_request != '' && (contains(github.event.comment.body, '/rebase') || contains(github.event.comment.body, '\rebase'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Automatic Rebase

View File

@ -28,7 +28,7 @@ jobs:
branch: 'master, 4.x-stable'
tag: '5*, 4*'
latest: '5*'
dingding-token: ${{ secrets.DINGDING_BOT_TOKEN }}
dingding-token: ${{ secrets.DINGDING_BOT_TOKEN }} ${{ secrets.DINGDING_BOT_COLLABORATOR_TOKEN }} ${{ secrets.DINGDING_BOT_MAINTAINER_TOKEN }}
dingding-msg: 'CHANGELOG.zh-CN.md'
msg-title: '# Ant Design {{v}} 发布日志'
msg-poster: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*zx7LTI_ECSAAAAAAAAAAAABkARQnAQ'

View File

@ -16,7 +16,7 @@ jobs:
if: (startsWith(github.ref, 'refs/tags/') && (contains(github.ref_name, '-') == false)) || github.event_name == 'workflow_dispatch'
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: cache package-lock.json
uses: actions/cache@v3
@ -49,7 +49,7 @@ jobs:
needs: setup
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:

View File

@ -23,7 +23,7 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:

View File

@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
@ -79,7 +79,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
@ -105,7 +105,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
@ -133,7 +133,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
@ -169,7 +169,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
@ -211,7 +211,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
@ -270,7 +270,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
@ -356,7 +356,7 @@ jobs:
needs: [normal-test]
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
@ -380,7 +380,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
@ -431,7 +431,7 @@ jobs:
- name: checkout
# lib only run in master branch not in pull request
if: ${{ github.event_name != 'pull_request' || matrix.module != 'lib' }}
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:

View File

@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.title, 'changelog') || contains(github.event.pull_request.title, 'release')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: verify-version
uses: actions-cool/verify-package-version@v1
with:

View File

@ -80,7 +80,7 @@
"lint:md": "remark . -f -q",
"lint:script": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:style": "stylelint '{site,components}/**/*.less'",
"pre-publish": "npm run test-all -- --skip-build",
"pre-publish": "npm run test-all -- --skip-build && node ./scripts/pre-publish-notice.js",
"prettier": "prettier -c --write **/*",
"rome:format": "rome format --write .",
"pub": "npm run version && antd-tools run pub",
@ -254,6 +254,7 @@
"mini-css-extract-plugin": "^1.6.2",
"mockdate": "^3.0.0",
"open": "^8.0.1",
"node-notifier": "^10.0.1",
"prettier": "^2.3.2",
"prettier-plugin-jsdoc": "^0.4.2",
"pretty-format": "^29.0.0",

View File

@ -47,6 +47,7 @@ const SAFE_DAYS_DIFF = 1000 * 60 * 60 * 24 * 3; // 3 days not update seems to be
// Sort and get the latest versions
const versionList = Object.keys(time)
.filter((version) => semver.satisfies(version, '4.x'))
.filter((version) => semver.valid(version) && !semver.prerelease(version))
.sort((v1, v2) => {
const time1 = moment(time[v1]).valueOf();
@ -111,9 +112,6 @@ const SAFE_DAYS_DIFF = 1000 * 60 * 60 * 24 * 3; // 3 days not update seems to be
choices: latestVersions.map((info) => {
const { value, publishTime, depreciated } = info;
const desc = moment(publishTime).fromNow();
//
return {
...info,
name: [

View File

@ -0,0 +1,9 @@
const { Notification } = require('node-notifier');
new Notification().notify({
title: '✅ 准备发布到 npm',
message: '测试用例执行完毕,快回来输入 npm 校验码了!',
sound: 'Crystal',
});
process.exit(0);