aboutsummaryrefslogtreecommitdiffstats
path: root/build/release/post-release.sh
blob: f5dd1a165fdef7e35a3e64dc77db7bfc74370b7e (plain)
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
#!/bin/sh

set -euo pipefail

# $1: Version
# $2: Blog URL

cdn=tmp/release/cdn
dist=tmp/release/dist

if [[ -z "$1" ]] then
	echo "Version is not set (1st argument)"
	exit 1
fi

if [[ -z "$2" ]] then
	echo "Blog URL is not set (2nd argument)"
	exit 1
fi

# Push files to cdn repo
npm run release:cdn $1
cd $cdn
git add -A
git commit -m "jquery: Add version $1"

# Wait for confirmation from user to push changes to cdn repo
read -p "Press enter to push changes to cdn repo"
git push
cd -

# Push files to dist repo
npm run release:dist $1 $2
cd $dist
git add -A
npm version $1

# Wait for confirmation from user to push changes to dist repo
read -p "Press enter to push changes to dist repo"
git push --follow-tags
cd -

# Restore AUTHORS URL
sed -i "s/$1\/AUTHORS.txt/main\/AUTHORS.txt/" package.json
git add package.json

# Remove built files from tracking.
# Leave the changelog.md committed.
# Leave the tmp folder as some files are needed
# after the release (such as for emailing archives).
npm run build:clean
git commit -m "Release: remove dist files from main branch"

# Wait for confirmation from user to push changes
read -p "Press enter to push changes to main branch"
git push