1 | #
|
2 | # Licensed under the Apache License, Version 2.0 (the "License");
|
3 | # you may not use this file except in compliance with the License.
|
4 | # You may obtain a copy of the License at
|
5 | #
|
6 | # http://www.apache.org/licenses/LICENSE-2.0
|
7 | #
|
8 | # Unless required by applicable law or agreed to in writing, software
|
9 | # distributed under the License is distributed on an "AS IS" BASIS,
|
10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11 | # See the License for the specific language governing permissions and
|
12 | # limitations under the License.
|
13 | #
|
14 |
|
15 | # This script assumes that
|
16 | # - the remote origin is set to a fork of the repo
|
17 | # - the remote upstream is set to the original repo
|
18 |
|
19 | # Exit on first error, print all commands.
|
20 | set -ev
|
21 | set -o pipefail
|
22 |
|
23 | # Make sure we have the latest code from origin/master on our fork
|
24 | git fetch --all --prune
|
25 | git checkout master
|
26 | git merge --ff-only upstream/master
|
27 | git pull origin master
|
28 |
|
29 | # Increase the version number
|
30 | npm run pkgbump
|
31 | TARGET_VERSION=$( jq -r '.version' package.json )
|
32 | git add package.json
|
33 | git commit -m "chore(release): Bump Markdown Editor source version" -s
|
34 |
|
35 | # Publish each package to NPM registry. Generate changelog and update package.json files
|
36 | npm publish --tag="${TARGET_VERSION}" 2>&1
|
37 |
|
38 | # Fix DCO sign-off
|
39 | git commit --amend -s --no-edit
|
40 | git push -f origin master
|
41 |
|
42 | # Merge into upstream/master
|
43 | echo "Publish of ${TARGET_VERSION} successful."
|
44 | echo "Now open a pull request to merge origin/master into upstream/master."
|