mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
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:
parent
bc46d4bec0
commit
a014f7cde2
@ -29,3 +29,6 @@ coverage
|
||||
# Scripts
|
||||
scripts/previewEditor/**/*
|
||||
jest-stare
|
||||
locale
|
||||
.dumi
|
||||
report.html
|
||||
|
4
.github/workflows/preview-build.yml
vendored
4
.github/workflows/preview-build.yml
vendored
@ -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:
|
||||
|
2
.github/workflows/rebase.yml
vendored
2
.github/workflows/rebase.yml
vendored
@ -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
|
||||
|
2
.github/workflows/release-helper.yml
vendored
2
.github/workflows/release-helper.yml
vendored
@ -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'
|
||||
|
4
.github/workflows/site-deploy.yml
vendored
4
.github/workflows/site-deploy.yml
vendored
@ -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:
|
||||
|
2
.github/workflows/size-limit.yml
vendored
2
.github/workflows/size-limit.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
|
22
.github/workflows/test.yml
vendored
22
.github/workflows/test.yml
vendored
@ -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:
|
||||
|
2
.github/workflows/verify-package-version.yml
vendored
2
.github/workflows/verify-package-version.yml
vendored
@ -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:
|
||||
|
@ -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",
|
||||
|
@ -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: [
|
||||
|
9
scripts/pre-publish-notice.js
Normal file
9
scripts/pre-publish-notice.js
Normal file
@ -0,0 +1,9 @@
|
||||
const { Notification } = require('node-notifier');
|
||||
|
||||
new Notification().notify({
|
||||
title: '✅ 准备发布到 npm',
|
||||
message: '测试用例执行完毕,快回来输入 npm 校验码了!',
|
||||
sound: 'Crystal',
|
||||
});
|
||||
|
||||
process.exit(0);
|
Loading…
Reference in New Issue
Block a user