Skip to content

Commit b8b0717

Browse files
committed
ci: add zip-upload template
1 parent 24504c8 commit b8b0717

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
parameters:
2+
# artifacts files or directory
3+
# props:
4+
# - path
5+
# - condition
6+
- name: artifacts
7+
type: object
8+
default: {}
9+
# the path to store the 7z file
10+
# the file is overwritten for each artifact
11+
- name: uploadPath
12+
type: string
13+
default: $(Build.ArtifactStagingDirectory)/artifact_zip_upload.7z
14+
15+
steps:
16+
- ${{ each artifact in parameters.artifacts }}:
17+
- task: ArchiveFiles@2
18+
inputs:
19+
rootFolderOrFile: ${{artifact.path}}
20+
archiveType: 7z
21+
sevenZipCompression: ultra
22+
archiveFile: ${{parameters.uploadPath}}
23+
replaceExistingArchive: true
24+
displayName: Compress ${{artifact.path}}
25+
${{ if artifact.condition }}:
26+
condition: ${{artifact.condition}}
27+
28+
- task: PublishBuildArtifacts@1
29+
inputs:
30+
PathtoPublish: ${{parameters.uploadPath}}
31+
ArtifactName: ${{artifact.path}}
32+
displayName: Upload ${{artifact.path}}
33+
${{ if artifact.condition }}:
34+
condition: ${{artifact.condition}}

0 commit comments

Comments
 (0)