-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
48 lines (46 loc) · 1.38 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
trigger:
- main
- containerTcpdump
pool:
vmImage: 'ubuntu-latest'
steps:
- task: GoTool@0
displayName: 'Golang version'
inputs:
version: '1.13.5'
- task: Go@0
inputs:
command: 'get'
arguments: '-d'
workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: CmdLine@2
displayName: 'Download UPX'
inputs:
script: 'wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz && tar -xvf ./upx-3.96-amd64_linux.tar.xz'
- task: Go@0
displayName: 'Build binary'
inputs:
command: 'build'
workingDirectory: '$(System.DefaultWorkingDirectory)'
arguments: '-o "$(System.DefaultWorkingDirectory)/k8stcpdump" -ldflags="-s -w"'
- task: CmdLine@2
displayName: 'Compress the binary with UPX'
inputs:
script: './upx-3.96-amd64_linux/upx --brute $(System.DefaultWorkingDirectory)/k8stcpdump'
- task: CopyFiles@2
inputs:
Contents: $(System.DefaultWorkingDirectory)/k8stcpdump
TargetFolder: '$(Build.ArtifactStagingDirectory)/k8stcpdump'
- task: PublishBuildArtifacts@1
inputs:
artifactName: k8stcpdump
- task: GitHubRelease@1
inputs:
gitHubConnection: 'ADO_k8stcpdump'
repositoryName: 'Shuanglu/k8sTcpdump'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: '$(Build.BuildNumber)'
assets: $(System.DefaultWorkingDirectory)/k8stcpdump
isPreRelease: true