forked from AzureAD/microsoft-authentication-library-for-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
post-release.yml
114 lines (113 loc) · 4.33 KB
/
post-release.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
resources:
pipelines:
- pipeline: releasePipeline
source: msal-javascript-internal-Buddy
trigger: true
pool:
vmImage: ubuntu-latest
stages:
- stage: update_packages
displayName: 'Update Packages'
jobs:
- job: update_and_push_to_github
steps:
- task: NodeTool@0
displayName: Install Node
inputs:
versionSpec: '16.x'
checkLatest: true
# Update each package with artifacts from release
- template: custom-templates/post-publish-template.yml
parameters:
name: 'msal_core'
libName: 'core'
cdn: true
- template: custom-templates/post-publish-template.yml
parameters:
name: 'msal_common'
libName: 'common'
- template: custom-templates/post-publish-template.yml
parameters:
name: 'msal_browser'
libName: 'browser'
- template: custom-templates/post-publish-template.yml
parameters:
name: 'msal_node'
libName: 'node'
- template: custom-templates/post-publish-template.yml
parameters:
name: 'msal_react'
libName: 'react'
- template: custom-templates/post-publish-template.yml
parameters:
name: 'msal_angular'
libName: 'angular'
- template: custom-templates/post-publish-template.yml
parameters:
name: 'msal_node_extensions'
libName: 'node-extensions'
path: 'extensions'
# Get GitHub PAT
- task: AzureKeyVault@2
condition: always()
continueOnError: true
inputs:
azureSubscription: 'MSIDLABKeyVault'
KeyVaultName: 'ADALTestInfo'
SecretsFilter: 'MSALJSGITHUB'
RunAsPreJob: true
# Create Pull Request from post-release-month-year to dev
- task: Npm@1
displayName: Install release scripts dependencies
condition: always()
inputs:
command: 'custom'
customCommand: 'ci'
workingDirectory: 'release-scripts/'
# Get Release Date
- task: CmdLine@2
displayName: 'Get Release Date'
condition: always()
inputs:
script: echo "##vso[task.setvariable variable=releaseDate]$(node getReleaseDate.js)"
workingDirectory: 'release-scripts/'
env:
TZ: "America/Los_Angeles"
# Create branch name from release date
- task: CmdLine@2
displayName: 'Get branch'
condition: always()
inputs:
script: echo "##vso[task.setvariable variable=branch]$(node getReleaseDate.js -branch)"
workingDirectory: 'release-scripts/'
env:
TZ: "America/Los_Angeles"
# Commit the changes and push to GitHub
- task: CmdLine@2
displayName: 'Commit and Push Changes'
condition: always()
inputs:
script: |
git config --global user.email "[email protected]"
git config --global user.name "Release Pipeline"
git checkout -b post-release-$(branch)
git status
git add .
git commit -m "$(releaseDate) Post Release"
git remote add upstream https://${GITHUBTOKEN}@github.com/AzureAD/microsoft-authentication-library-for-js.git
git pull upstream post-release-$(branch)
git push upstream post-release-$(branch)
env:
GITHUBTOKEN: $(MSALJSGITHUB)
# Create Pull Request through GitHub's REST API
- script: node pullRequest.js --titleDate=$(releaseDate) --branch=post-release-$(branch)
displayName: "Post Release Pull Request"
condition: succeeded()
workingDirectory: 'release-scripts/'
name: post_release_pull_request
env:
GITHUBTOKEN: $(MSALJSGITHUB)