@@ -41,6 +41,8 @@ publishPackage() {
41
41
repoUrl=" https://github.com/angular/${packageRepo} .git"
42
42
repoDir=" tmp/${packageRepo} "
43
43
44
+ echo " Starting publish process of ${packageName} for ${commitTag} .."
45
+
44
46
if [[ ! ${COMMAND_ARGS} == * --no-build* ]]; then
45
47
# Create a release of the current repository.
46
48
$( npm bin) /gulp ${packageName} :build-release:clean
@@ -50,16 +52,24 @@ publishPackage() {
50
52
rm -rf ${repoDir}
51
53
mkdir -p ${repoDir}
52
54
55
+ echo " Starting cloning process of ${repoUrl} into ${repoDir} .."
56
+
53
57
# Clone the repository and only fetch the last commit to download less unused data.
54
58
git clone ${repoUrl} ${repoDir} --depth 1
55
59
60
+ echo " Successfully cloned ${repoUrl} into ${repoDir} ."
61
+
56
62
# Copy the build files to the repository
57
63
rm -rf ${repoDir} /*
58
64
cp -r ${buildDir} /* ${repoDir}
59
65
66
+ echo " Removed everything from ${packageRepo} and added the new build output."
67
+
60
68
# Create the build commit and push the changes to the repository.
61
69
cd ${repoDir}
62
70
71
+ echo " Switched into the repository directory (${repoDir} )."
72
+
63
73
if [[ $( git ls-remote origin " refs/tags/${commitTag} " ) ]]; then
64
74
echo " Skipping publish because tag is already published"
65
75
exit 0
@@ -68,7 +78,9 @@ publishPackage() {
68
78
# Replace the version in every file recursively with a more specific version that also includes
69
79
# the SHA of the current build job. Normally this "sed" call would just replace the version
70
80
# placeholder, but the version placeholders have been replaced by the release task already.
71
- sed -i " s/${buildVersion} /${commitTag} /g" $( find . -type f)
81
+ sed -i " s/${buildVersion} /${commitTag} /g" $( find . -type f -not -path ' *\/.*' )
82
+
83
+ echo " Updated the build version in every file to include the SHA of the latest commit."
72
84
73
85
# Prepare Git for pushing the artifacts to the repository.
74
86
git config user.name " ${commitAuthorName} "
@@ -77,6 +89,8 @@ publishPackage() {
77
89
78
90
echo " https://${MATERIAL2_BUILDS_TOKEN} :@github.com" > .git/credentials
79
91
92
+ echo " Git configuration has been updated to match the last commit author. Publishing now.."
93
+
80
94
git add -A
81
95
git commit --allow-empty -m " ${commitMessage} "
82
96
git tag " ${commitTag} "
0 commit comments