-
Notifications
You must be signed in to change notification settings - Fork 10
/
release.sh
executable file
·88 lines (67 loc) · 1.42 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
version=$1
function update_package_json() {
local package=$1
local version=$2
echo "-----> Updating $package to version $version"
cd $package
npm version $version
cd ..
}
function release_dash_package() {
local package=$1
echo "-----> Releasing $package"
cd $package
. venv/bin/activate
npm run build
rm -r ./dist
python3 setup.py sdist bdist_wheel
twine upload dist/*
deactivate
cd ..
}
function release_js_package() {
local package=$1
echo "-----> Releasing $package"
cd $package
npm pkg set main="dist/index.js"
npm run build
npm publish --access public
npm pkg set main="src/index.js"
cd ..
}
function publish_application() {
local application=$1
echo "-----> Publishing $application"
cd $application
npm run build
rsync -r --delete ./build/ $WEBSITE_USER@$WEBSITE_HOST:~/domains/spread-grid.tomasz-rewak.com/public_nodejs/public
cd ..
}
packages=(
"lib"
"react"
"dash"
)
applications=(
"docs"
)
js_packages=(
"lib"
"react"
)
dash_packages=(
"dash"
)
for package in ${packages[@]}; do
update_package_json $package $version
done
for package in ${js_packages[@]}; do
release_js_package $package
done
for package in ${dash_packages[@]}; do
release_dash_package $package
done
for application in ${applications[@]}; do
publish_application $application
done