|
@@ -47,6 +47,47 @@ steps:
|
47
|
47
|
commands:
|
48
|
48
|
- rm -rf docs
|
49
|
49
|
- npm run docs
|
|
50
|
+ trigger:
|
|
51
|
+ event:
|
|
52
|
+ - tag
|
|
53
|
+
|
|
54
|
+- name: npm publish
|
|
55
|
+ image: plugins/npm
|
|
56
|
+ settings:
|
|
57
|
+ username: frontwork
|
|
58
|
+ password:
|
|
59
|
+ from_secret: npm_password
|
|
60
|
+ email: frontwork.me@gmail.com
|
|
61
|
+ trigger:
|
|
62
|
+ event:
|
|
63
|
+ - tag
|
|
64
|
+
|
|
65
|
+- name: versioning
|
|
66
|
+ image: node:12
|
|
67
|
+ commands:
|
|
68
|
+ - git config --global user.email "frontwork.me@gmail.com"
|
|
69
|
+ - git config --global user.name "drone"
|
|
70
|
+ - PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
|
|
71
|
+ - LATEST_VERSION=$(npm view rpclibrary | grep latest | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
|
|
72
|
+ - if [ "${PACKAGE_VERSION}" != "${LATEST_VERSION}" ];
|
|
73
|
+ then
|
|
74
|
+ git tag $PACKAGE_VERSION
|
|
75
|
+ git status
|
|
76
|
+ git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fw-vendor/${DRONE_REPO_NAME}.git master $PACKAGE_VERSION;
|
|
77
|
+ else
|
|
78
|
+ echo 'Version: '
|
|
79
|
+ echo $LATEST_VERSION
|
|
80
|
+ echo 'did not change. Don`t push tag to master';
|
|
81
|
+ fi
|
|
82
|
+ environment:
|
|
83
|
+ GIT_USER:
|
|
84
|
+ from_secret: git_user
|
|
85
|
+ GIT_PASSWORD:
|
|
86
|
+ from_secret: git_password
|
|
87
|
+ trigger:
|
|
88
|
+ event:
|
|
89
|
+ exclude:
|
|
90
|
+ - tag
|
50
|
91
|
|
51
|
92
|
- name: commit documentation
|
52
|
93
|
image: node:12
|
|
@@ -63,14 +104,9 @@ steps:
|
63
|
104
|
from_secret: git_user
|
64
|
105
|
GIT_PASSWORD:
|
65
|
106
|
from_secret: git_password
|
66
|
|
-
|
67
|
|
-- name: npm publish
|
68
|
|
- image: plugins/npm
|
69
|
|
- settings:
|
70
|
|
- username: frontwork
|
71
|
|
- password:
|
72
|
|
- from_secret: npm_password
|
73
|
|
- email: frontwork.me@gmail.com
|
|
107
|
+ trigger:
|
|
108
|
+ event:
|
|
109
|
+ - tag
|
74
|
110
|
|
75
|
111
|
volumes:
|
76
|
112
|
- name: cache
|