forked from apache/echarts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
26 lines (26 loc) · 1.02 KB
/
Jenkinsfile
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
pipeline {
agent { label "node12" }
options { disableConcurrentBuilds() }
stages {
stage("Checkout") {
steps {
cleanWs()
checkout([$class: 'GitSCM', branches: [[name: '$BRANCH_NAME']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '83ff6dc5-45b4-4996-b383-e1f225203f3c', url: 'git@github.com:amilabs/incubator-echarts.git']]])
}
}
stage("Publish") {
when { tag 'v*' }
steps {
script{
withCredentials([string(credentialsId: 'amilabs-npm-token', variable: 'NPM_TOKEN')]) {
sh 'npm i'
sh "echo //registry.npmjs.org/:_authToken=${env.NPM_TOKEN} > .npmrc"
sh "echo email=jenkins@amilabs.pro >> .npmrc"
sh "echo always-auth=true >> .npmrc"
sh "npm publish"
}
}
}
}
}
}