Skip to content

Commit

Permalink
chore: fix 4.x-stable publish script (ant-design#44665)
Browse files Browse the repository at this point in the history
* chore: fix 4.x-stable publish script

* chore: add notice before publish to npm (ant-design#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
  • Loading branch information
afc163 authored Sep 7, 2023
1 parent bc46d4b commit a014f7c
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ coverage
# Scripts
scripts/previewEditor/**/*
jest-stare
locale
.dumi
report.html
4 changes: 2 additions & 2 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
needs: setup
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/site-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
needs: setup
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-package-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions scripts/post-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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: [
Expand Down
9 changes: 9 additions & 0 deletions scripts/pre-publish-notice.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { Notification } = require('node-notifier');

new Notification().notify({
title: '✅ 准备发布到 npm',
message: '测试用例执行完毕,快回来输入 npm 校验码了!',
sound: 'Crystal',
});

process.exit(0);

0 comments on commit a014f7c

Please sign in to comment.