forked from tinacms/tinacms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·49 lines (39 loc) · 1.01 KB
/
release.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
#!/bin/bash
# Terminate after the first line that fails (returns nonzero exit code)
set -e
source $(dirname $0)/require_clean_work_tree.sh
# 0.1. Confirm Action
read -p "Create a new release? Type the word 'release' to confirm: "
if [[ ! $REPLY =~ ^release$ ]]
then
echo "Release canceled."
exit 1
fi
#0.2. Ensure no uncommitted changes
require_clean_work_tree
# 1. Update Matser
git checkout master
git pull
# 2. Update Latest
git checkout latest
git pull
git merge master
# 3. Run a Fresh Build
npm run hard-reset
# 4. Generate CHANGELOGs and Git Tags
# You must have GH_TOKEN in your environment variables
lerna version \
--yes \
--conventional-commits \
--conventional-graduate \
--allow-branch latest \
--create-release github \
-m "chore(publish): latest" \
--ignore-changes '**/*.md' '**/*.test.tsx?' '**/package-lock.json' '**/tsconfig.json' \
--no-granular-pathspec
# 5. Publish to NPM
lerna publish from-package --yes
# 7. Backmerge to master
git checkout master
git merge latest
git push