UNPKG

1.47 kBapplication/x-shView Raw
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.
20set -ev
21set -o pipefail
22
23# Make sure we have the latest code from origin/master on our fork
24git fetch --all --prune
25git checkout master
26git merge --ff-only upstream/master
27git pull origin master
28
29# Increase the version number
30npm run pkgbump
31TARGET_VERSION=$( jq -r '.version' package.json )
32git add package.json
33git 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
36npm publish --tag="${TARGET_VERSION}" 2>&1
37
38# Fix DCO sign-off
39git commit --amend -s --no-edit
40git push -f origin master
41
42# Merge into upstream/master
43echo "Publish of ${TARGET_VERSION} successful."
44echo "Now open a pull request to merge origin/master into upstream/master."