-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathnew-version.sh
executable file
·75 lines (66 loc) · 1.94 KB
/
new-version.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
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
if [ "$#" == "0" ]; then
printf "No version given\n"
exit 1
fi
VERSION=$1
PREV_VERSION=$(cat ./app-config-main/package.json | jq -r .version)
if [ -n "$(git status --porcelain)" ]; then
printf "Git status is not clean\n"
# exit 2
fi
if [ "$VERSION" == "$PREV_VERSION" ]; then
printf "Same version as before\n"
exit 3
fi
printf "Version $PREV_VERSION -> $VERSION\n"
replace_version_references() {
sed -i "s#\([\"]@app-config\\/[a-z-]*[\"]: [\"]\)\\^$PREV_VERSION[\"]#\\1^$VERSION\"#g" $@
sed -i "s#\([\"]@lcdev\\/app-config-[a-z-]*[\"]: [\"]\)\\^$PREV_VERSION[\"]#\\1^$VERSION\"#g" $@
git add $@
}
new_version() {
local prev=$(pwd)
cd $1
yarn version --new-version $VERSION --no-git-tag-version
git add ./package.json
replace_version_references $(realpath ./package.json)
cd $prev
}
new_version app-config-cli
new_version app-config-config
new_version app-config-core
new_version app-config-cypress
new_version app-config-default-extensions
new_version app-config-electron
new_version app-config-encryption
new_version app-config-esbuild
new_version app-config-exec
new_version app-config-extension-utils
new_version app-config-extensions
new_version app-config-generate
new_version app-config-git
new_version app-config-inject
new_version app-config-js
new_version app-config-logging
new_version app-config-main
new_version app-config-meta
new_version app-config-node
new_version app-config-react-native
new_version app-config-rollup
new_version app-config-schema
new_version app-config-settings
new_version app-config-test-utils
new_version app-config-utils
new_version app-config-v1-compat
new_version app-config-vault
new_version app-config-vite
new_version app-config-webpack
new_version lcdev-app-config
new_version lcdev-app-config-inject
new_version lcdev-app-config-webpack-plugin
new_version lcdev-react-native-app-config-transformer
git commit -m "chore: release v$VERSION"
git tag v$VERSION