File tree 4 files changed +64
-6
lines changed
4 files changed +64
-6
lines changed Original file line number Diff line number Diff line change 2
2
"version" : " 3.2.0" ,
3
3
"command" : {
4
4
"version" : {
5
- "allowBranch" : [
6
- " master"
7
- ],
8
5
"conventionalCommits" : true
9
6
},
10
7
"publish" : {
Original file line number Diff line number Diff line change 38
38
"test:unit" : " karma start --single-run" ,
39
39
"test:dependency" : " ./scripts/dependency-test.sh" ,
40
40
"test:feature-targeting" : " node test/scss/verify-feature-targeting.js" ,
41
- "test:site" : " npm run clean:site && ./scripts/site-generator-test.sh"
41
+ "test:site" : " npm run clean:site && ./scripts/site-generator-test.sh" ,
42
+ "version" : " cat lerna.json | grep -e '^ \" version\" : ' | awk '{print $2}' | sed 's/[\" ,]//g'"
42
43
},
43
44
"devDependencies" : {
44
45
"@babel/core" : " ^7.4.5" ,
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ function log() {
6
+ echo ' \033[36m[canary-release]\033[0m' " $@ "
7
+ }
8
+
9
+ function fail() {
10
+ echo ' \033[31mFAILURE:\033[0m' " $@ "
11
+ }
12
+
13
+ log " Preparing for canary release..."
14
+
15
+ log " Installing dependencies..."
16
+ if ! npm i; then
17
+ fail " npm install failed."
18
+ exit 1
19
+ fi
20
+ echo " "
21
+
22
+ log " Running pre-release script..."
23
+ if ! ./scripts/pre-release.sh; then
24
+ fail " Pre-release script failed"
25
+ exit 1
26
+ fi
27
+
28
+ log " Bumping up MDC Web version to canary..."
29
+ if ! npx lerna version premajor --no-git-tag-version --no-push --preid canary.$( git rev-parse --short HEAD) --yes; then
30
+ fail " lerna version command failed"
31
+ exit 1
32
+ fi
33
+ echo " "
34
+
35
+ PREVIOUS_GIT_BRANCH=$( git rev-parse --abbrev-ref HEAD)
36
+ CANARY_RELEASE_VERSION=$( npm run version --silent)
37
+ CANARY_RELEASE_BRANCH=release/v$( npm run version --silent)
38
+
39
+ log " Creating temporary release branch..."
40
+ git checkout -B $CANARY_RELEASE_BRANCH
41
+ git commit -am " chore: Publish"
42
+ echo " "
43
+
44
+ log " Publishing packages to NPM..."
45
+ if ! npx lerna publish from-package --dist-tag canary; then
46
+ fail " NPM Publish was not successful"
47
+ exit 1
48
+ fi
49
+ echo " "
50
+
51
+ log " Creating release..."
52
+ git tag v$( npm run version --silent)
53
+ echo " "
54
+
55
+ log " Cleaning up..."
56
+ git checkout $PREVIOUS_GIT_BRANCH
57
+ git branch -D $CANARY_RELEASE_BRANCH
58
+ echo " "
59
+
60
+ log " MDC Web v$CANARY_RELEASE_VERSION is successfully published!"
61
+ echo " "
Original file line number Diff line number Diff line change @@ -76,6 +76,5 @@ log "Verifying that all packages are correctly pointing main to dist..."
76
76
node scripts/verify-pkg-main.js
77
77
echo " "
78
78
79
- log " Pre-release steps done! Next, continue with the Release step in the Release Process documentation:"
80
- echo " https://github.com/material-components/material-components-web/blob/master/docs/open_source/release-process.md#release"
79
+ log " Pre-release steps done! Next, continue with the Release process."
81
80
echo " "
You can’t perform that action at this time.
0 commit comments