-
Notifications
You must be signed in to change notification settings - Fork 142
/
Copy pathgithub-azure-pipelines-upgrade-version-and-publish.yml
77 lines (73 loc) · 2.24 KB
/
github-azure-pipelines-upgrade-version-and-publish.yml
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
76
77
variables:
- group: deployer-variables
- group: develop-branch
- group: master-branch
trigger:
branches:
include:
- master
pr: none
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: upgrade_version_and_publish
displayName: 'Upgrade version and publish'
jobs:
- job: upgrade_version_and_publish
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- checkout: self
persistCredentials: true
- script:
git checkout $(MASTER_BRANCH_NAME)
displayName: 'Switch branch'
- script:
npm install
displayName: 'Install dependencies'
- script:
npm run remove-suffix
displayName: 'Remove suffix from package version'
- script:
npm run pre-deploy
displayName: 'Build TypeScript code'
- task: Npm@1
inputs:
command: 'custom'
customCommand: 'publish dist --access=public'
customEndpoint: 'npm ReactGrid deployment service'
- script:
git config --global user.email "$(GIT_USER_MAIL)" && git config --global user.name "$(GIT_USER_NAME)"
displayName: 'Set configuration'
- script:
git add .
displayName: 'Add changes'
- script:
git commit -m "upgrade version [ci skip]"
displayName: 'Commit updated package version'
- script:
git push
displayName: 'Push upgraded version'
- script:
git checkout $(DEVELOP_BRANCH_NAME)
displayName: 'Change branch to develop'
- script:
npm run remove-suffix
displayName: 'Remove suffix from develop package version'
- script:
npm install
displayName: 'Update package-lock.json'
- script:
git pull
displayName: 'Pull changes'
- script:
git add .
displayName: 'Add changes'
- script:
git commit -m "upgrade version [ci skip]"
displayName: 'Commit updated package version'
- script:
git push
displayName: 'Push upgraded version'