-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpublish.sh
executable file
·64 lines (51 loc) · 1.5 KB
/
publish.sh
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
#!/bin/bash
ORG=adobe
REPO=aem-boilerplate
FILENAME=scripts/aem.js
VERSION=$1
TYPE=$2 # can be major, minor, patch
# VERSION with all dots replaced by dashes
VERSION_DASH=${VERSION//./-}
BRANCH=update-lib-aem-$TYPE-$VERSION_DASH
cd ..
echo "Using gh version: $(gh --version)"
gh repo clone $ORG/$REPO
cp aem-lib/dist/aem.js $REPO/$FILENAME
cd $REPO
echo "Creating branch $BRANCH"
git checkout -b $BRANCH
git add $FILENAME
echo "Committing changes"
# case $TYPE in major, minor, patch
case $TYPE in
major)
git commit -m "feat(lib): update $FILENAME to aem.js@$VERSION
Test URL: https://$BRANCH--$REPO--$ORG.hlx.live/
BREAKING CHANGE: please check https://github.com/adobe/aem-lib/releases/tag/v$VERSION for breaking changes
"
;;
minor)
git commit -m "feat(lib): update $FILENAME to aem.js@$VERSION
Test URL: https://$BRANCH--$REPO--$ORG.hlx.live/
Release Notes: https://github.com/adobe/aem-lib/releases/tag/v$VERSION
"
;;
patch)
git commit -m "fix(lib): update $FILENAME to aem.js@$VERSION
Test URL: https://$BRANCH--$REPO--$ORG.hlx.live/
Release Notes: https://github.com/adobe/aem-lib/releases/tag/v$VERSION
"
;;
*)
echo "Invalid type: $TYPE"
exit 1
;;
esac
echo "Ready to create PR"
gh repo set-default $ORG/$REPO
git remote add token-authed-github https://${GITHUB_TOKEN}@github.com/$ORG/$REPO
echo "Successfully added remote"
echo git push --set-upstream token-authed-github $BRANCH
git push --set-upstream token-authed-github $BRANCH
echo gh pr create -f
gh pr create -f