Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): exact tag date version #556

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
modify-services:
if: github.repository == 'Tencent/tdesign'
runs-on: ubuntu-latest
outputs:
services-changed: ${{ steps.services-changed.outputs.changed }}
Expand Down
15 changes: 10 additions & 5 deletions packages/auto-release/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export function getReleaseData() {
/**
* @description 检查日期是否在指定日期范围内
* 在每个月的1号、8号、15号、22号生成
* 1号生成上个月的22号到最后一天的版本
* 8号生成这个月的1号到7号的版本
* 15号生成这个月的8号到14号的版本
* 22号生成这个月的15号到21号的版本
* 1号(原应在29号):生成上个月的22号 - 最后一天的版本(原应在28号)
* 8号:生成这个月的1号 - 7号的版本
* 15号:生成这个月的8号 - 14号的版本
* 22号:生成这个月的15号 - 21号的版本
*/

let START_DATE = '';
Expand All @@ -65,27 +65,32 @@ export function getReleaseData() {
const monthShort = today.toLocaleString('en-US', { month: 'short' });
const year = today.getFullYear();
let times = '1st';
let tagDay = today.getDate();

console.log('today', today.getDate());
switch (today.getDate()) {
case 1:
tagDay = 28;
times = '4th';
break;
case 8:
tagDay = 7;
times = '1st';
break;
case 15:
tagDay = 14;
times = '2nd';
break;
case 22:
tagDay = 21;
times = '3rd';
break;
default:
times = '1st';
break;
}

const tag = `v${today.getFullYear()}.${today.getMonth() + 1}.${today.getDate()}`;
const tag = `v${today.getFullYear()}.${today.getMonth() + 1}.${tagDay}`;
RSS1102 marked this conversation as resolved.
Show resolved Hide resolved
const title = `TDesign Weekly Release (${monthShort} ${times} ${year})`;

console.log('tag', tag);
Expand Down