newspack-scripts 3.3.1 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/post-release.sh +22 -5
package/package.json
CHANGED
package/post-release.sh
CHANGED
|
@@ -32,9 +32,26 @@ else
|
|
|
32
32
|
fi
|
|
33
33
|
|
|
34
34
|
# Update master branch with latest changes from the release branch, so they are in sync.
|
|
35
|
-
echo '[newspack-scripts] Merging the release branch into master'
|
|
35
|
+
echo '[newspack-scripts] Merging the release branch into master.'
|
|
36
36
|
git checkout master
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
|
|
38
|
+
# Merge release branch into master branch, and notify the team if any conflicts arise.
|
|
39
|
+
git merge --no-ff release -m "chore(release): merge in release $LATEST_VERSION_TAG"
|
|
40
|
+
if [[ $? == 0 ]]; then
|
|
41
|
+
echo '[newspack-scripts] Pushing updated master to origin.'
|
|
42
|
+
git push "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git"
|
|
43
|
+
else
|
|
44
|
+
git merge --abort
|
|
45
|
+
echo '[newspack-scripts] Post-release merge to master failed.'
|
|
46
|
+
if [ -z "$SLACK_CHANNEL_ID" ] || [ -z "$SLACK_AUTH_TOKEN" ]; then
|
|
47
|
+
echo '[newspack-scripts] Missing Slack channel ID and/or token. Cannot notify.'
|
|
48
|
+
else
|
|
49
|
+
echo '[newspack-scripts] Notifying the team on Slack.'
|
|
50
|
+
curl \
|
|
51
|
+
--data "{\"channel\":\"$SLACK_CHANNEL_ID\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"⚠️ Post-release merge failed for: \`$CIRCLE_PROJECT_REPONAME\`. Check <$CIRCLE_BUILD_URL|the build> for details.\"}}]}" \
|
|
52
|
+
-H "Content-type: application/json" \
|
|
53
|
+
-H "Authorization: Bearer $SLACK_AUTH_TOKEN" \
|
|
54
|
+
-X POST https://slack.com/api/chat.postMessage \
|
|
55
|
+
-s > /dev/null
|
|
56
|
+
fi
|
|
57
|
+
fi
|