-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathversion.json5
86 lines (86 loc) · 2.11 KB
/
version.json5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
vars: {
major: 3,
minor: 6,
patch: 0,
build: 20210317,
revision: 0,
tz: 'America/Los_Angeles',
sequence: 6,
},
calcVars: {
nextBuild: '{now.year * 10000 + (now.month + 1) * 100 + now.day}',
},
operations: {
incrMajor: '{major += 1; minor = 0; patch = 0; revision = 0; build = nextBuild}',
incrMinor: '{minor += 1; patch = 0; revision = 0; build = nextBuild}',
incrPatch: '{patch += 1; revision = 0; build = nextBuild}',
incrRevision: '{revision += 1; build = nextBuild}',
},
targets: [
{
description: 'License file',
files: [
'LICENSE',
],
action: {
updates: [
{
search: '(?<begin>Copyright \\(c\\) )[0-9]{4}',
replace: '{`${begin}${now.year}`}',
},
],
},
},
{
description: 'Node package',
files: [
'package.json',
],
action: {
updates: [
{
search: '^(?<begin> *"version" *: *")\\d+\\.\\d+\\.\\d+(?<end>" *, *)$',
replace: '{`${begin}${major}.${minor}.${patch}${end}`}',
},
],
},
},
{
description: 'TS version',
files: [
'src/version.ts',
],
action: {
updates: [
{
search: '^(?<begin>\\s*export\\s*const\\s*shortVersion\\s*=\\s*")\\d+\\.\\d+\\.\\d+(?<end>"\\s*)$',
replace: '{`${begin}${major}.${minor}.${patch}${end}`}',
},
{
search: '^(?<begin>\\s*export\\s*const\\s*fullVersion\\s*=\\s*")\\d+\\.\\d+\\.\\d+[+-]\\d+\\.\\d+(?<end>"\\s*)$',
replace: '{`${begin}${major}.${minor}.${patch}+${build}.${revision}${end}`}',
},
],
},
},
{
description: 'Git tag name',
files: [
'scratch/version.tag.txt',
],
action: {
write: '{`${major}.${minor}.${patch}`}',
},
},
{
description: 'Git tag description',
files: [
'scratch/version.desc.txt',
],
action: {
write: '{`Version ${major}.${minor}.${patch}+${build}.${revision}`}',
},
},
],
}