/
azure-pipelines.yml
70 lines (61 loc) · 1.86 KB
/
azure-pipelines.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
trigger:
- main
pool:
vmImage: "ubuntu-latest"
steps:
- checkout: self
clean: "true"
persistCredentials: "true"
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: "14.x"
- bash: |
echo ">>> Configure Git & NPM auth"
git config --global user.name $(GIT_COMMITTER_NAME)
git config --global user.email $(GIT_COMMITTER_EMAIL)
git checkout main --progress --force
echo -e "registry=https://registry.npmjs.org/\nalways-auth=true" >> .npmrc
echo ">>> Build"
npm ci
npm run release
echo "##vso[task.setvariable variable=latest_tag]$(git describe --tags --abbrev=0)"
npm run remote:release
npm run build
displayName: "Build"
condition: succeeded()
env:
GIT_COMMITTER_EMAIL: $(GIT_COMMITTER_EMAIL)
GIT_COMMITTER_NAME: $(GIT_COMMITTER_NAME)
- task: npmAuthenticate@0
displayName: "Authenticate NPM"
inputs:
workingFile: .npmrc
customEndpoint: npmjs.org_automation
- task: Npm@1
displayName: "Publish to NPM"
inputs:
command: publish
publishRegistry: useExternalRegistry
publishEndpoint: npmjs.org_automation
- task: CopyFiles@2
displayName: "Copy .mtar to staging directory"
inputs:
Contents: "mta_archives/**"
TargetFolder: $(Build.ArtifactStagingDirectory)
- task: GitHubRelease@0
displayName: "Create GitHub release"
inputs:
gitHubConnection: github.com_leo-ls
repositoryName: leo-ls/cf-destination-proxy
action: create
tagSource: manual
tag: $(LATEST_TAG)
releaseNotesSource: file
releaseNotesFile: ./remote/RELEASE.md
assets: $(Build.ArtifactStagingDirectory)/mta_archives/*.mtar
isDraft: false
addChangeLog: false
- bash: git push --follow-tags origin main
displayName: "Push results"
condition: succeeded()