-
Notifications
You must be signed in to change notification settings - Fork 16
/
publishit2gitonly.sh
executable file
·71 lines (59 loc) · 1.68 KB
/
publishit2gitonly.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
# exit on error
set -e
PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
npx git-changelog-command-line --ignore-commits-without-issue -std -tec "
# Changelog
Changelog for {{ownerName}} {{repoName}}.
{{#tags}}
## {{name}}
{{#issues}}
{{#hasIssue}}
{{#hasLink}}
### {{name}} [{{issue}}]({{link}}) {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}}
{{/hasLink}}
{{^hasLink}}
### {{name}} {{issue}} {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}}
{{/hasLink}}
{{/hasIssue}}
{{^hasIssue}}
### {{name}}
{{/hasIssue}}
{{#commits}}
**{{{messageTitle}}}**
{{#messageBodyItems}}
* {{.}}
{{/messageBodyItems}}
[{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}) *{{commitTime}}*
{{/commits}}
{{/issues}}
{{/tags}}
" >CHANGELOG.md
git commit -m "Update CHANGELOG.md" CHANGELOG.md && true
git push
git tag -f $PACKAGE_VERSION
git push --tags --force
[ -d ".vscode_test" ] && cp -r .vscode-test ..
git clean -fdx
npm install
git push
rm -f *.vsix
vsce package
COMMIT_LOG=$(git log -1 --format='%ci %H %s')
PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
github-release delete \
--owner=spgennard \
--repo=vscode_cobol \
--tag="$PACKAGE_VERSION" \
--name=$PACKAGE_VERSION \
&& true
github-release upload \
--owner=spgennard \
--repo=vscode_cobol \
--tag="$PACKAGE_VERSION" \
--name=$PACKAGE_VERSION \
--body="${COMMIT_LOG}" \
cobol*.vsix
mkdir .vscode-test 2>/dev/null && true
[ -d "../.vscode_test" ] && cp -r ../.vscode-test .
npm-check-updates
echo "use: ncu -u"