-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.sh
executable file
·44 lines (33 loc) · 1008 Bytes
/
publish.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
#!/bin/bash
set -e
versionBumpUp() {
npx nx run-many --parallel=1 --target=version --all -- --releaseAs=$1 --skipCommit=true
git commit -m 'Release: Version bump-up' packages/*/package.json packages/*/CHANGELOG.md
}
publish() {
local package=$1
local publishedPackageName=$2
npx nx build "${package}"
if [ "${package}" == "cli" ]; then
cp -f README.md dist/packages/cli/README.md
fi
cd "dist/packages/${package}"
npm pkg set "name"="${publishedPackageName}"
npm publish --access public
cd - > /dev/null
}
# versionBumpUp "major"
versionBumpUp "minor"
# versionBumpUp "patch"
./generateDocs.sh
git commit -m 'Release: Generate docs' README.md
cd "dist/packages/cli"
packageVersion=$(npm pkg get "version" | tr -d '"')
cd - > /dev/null
git tag -a "v${packageVersion}" -m "Release version ${packageVersion}"
#git tag -d "core-${packageVersion}"
#git tag -d "cli-${packageVersion}"
git push --follow-tags
publish core "@awsu/core"
publish cli "@awsu/cli"
publish cli "awsu-cli"