-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
74 lines (64 loc) · 1.66 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
71
72
73
74
trigger:
- master
- refs/tags/*
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
archiveType: tar
archiveExt: .tar.gz
mac:
imageName: 'macos-10.13'
archiveType: tar
archiveExt: .tar.gz
windows:
imageName: 'vs2017-win2016'
archiveType: zip
archiveExt: .zip
pool:
vmImage: $(imageName)
steps:
- task: GoTool@0
inputs:
version: '1.13.6'
- task: UseTaskfile@0
inputs:
version: '2.8'
- script: task build:release
displayName: Build binary
- powershell: |
$output = task get-output
echo "##vso[task.setvariable variable=output]$output"
displayName: Get target output
- powershell: |
$tag = "$(Build.SourceBranch)" -replace "refs/tags/", ""
echo "##vso[task.setvariable variable=tag]$tag"
displayName: Get tag
- task: CopyFiles@2
inputs:
Contents: |
README.md
LICENSE
TargetFolder: 'dist'
displayName: Copy Readme.md and LICENSE
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: 'dist'
includeRootFolder: false
archiveType: $(archiveType)
archiveFile: $(Build.ArtifactStagingDirectory)/$(output)$(archiveExt)
replaceExistingArchive: true
condition: contains(variables['Build.SourceBranch'], 'refs/tags/')
displayName: Archive
- task: GitHubRelease@1
inputs:
gitHubConnection: 'github.com_paulvarache'
repositoryName: '$(Build.Repository.Name)'
action: 'edit'
target: '$(Build.SourceVersion)'
tag: $(tag)
assets: '$(Build.ArtifactStagingDirectory)/*'
assetUploadMode: 'replace'
addChangeLog: false
condition: contains(variables['Build.SourceBranch'], 'refs/tags/')
displayName: Release on Github